提交时间:2023-08-24 20:58:56

运行 ID: 100125

#include <iostream> using namespace std; int db[10]={6,2,5,5,4,5,6,3,7,6},a[2005],ans; #define int long long signed main(){ int n; cin >> n; for (int i = 1;i<=2000;i++){ int j = i; while (j>=1){ a[i]+=db[j%10]; j/=10; } } for (int i = 0;i<=1000;i++){ for (int j = 0;j<=1000;j++){ if (a[i]+a[j]+a[i+j]+4==n) ans++; } } cout << ans; }