提交时间:2023-08-24 21:07:37

运行 ID: 100128

#include <iostream> using namespace std; int db[10]={6,2,5,5,4,5,6,3,7,6},a[2005],ans; int main(){ int n; cin >> n; a[0]=6; for (int i = 1;i<=2000;i++){ int j = i; while (j>0){ 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; }