提交时间:2023-08-24 10:04:32

运行 ID: 99895

#include <bits/stdc++.h> using namespace std; int num[]={6,2,5,5,4,5,6,3,7,6}; int count(int k) { if(k==0)return 6; int res = 0; while(k) { res+=num[k%10]; k/=10; } return res; } signed main() { int n,cnt=0; cin >> n; n-=4; int a,b,c; for(int a = 0; a <= 1145; a++) { for(int b = a+1; b <= 1145; b++) { c = a+b; if(count(a)+count(b)+count(c)==n) { //cout << count(a) << " " << count(b) << " " << count(c) << endl; //cout << a << "+" << b << "=" << c << endl; cnt++; cnt++; } } if(count(a)+count(a)+count(a+a)==n) { cnt++; } } //cout << count(100) << endl; cout << cnt << endl; return 0; }