题意分析
暴力枚举
代码总览
#include<bits/stdc++.h>
using namespace std;
const int nmax = 1000;
int cnt[] = {6,2,5,5,4,5,6,3,7,6};
int n;
int get(int x){
if(x == 0) return 6;
int tot = 0;
while(x){
int t = x % 10;
tot += cnt[t];
x /= 10;
}
return tot;
}
int main(){
while(scanf("%d",&n)!=EOF){
n-=4;
int ans = 0;
for(int i = 0;i<nmax;++i){
for(int j = 0;j<nmax;++j){
if(get(i) + get(j) + get(i+j) == n){
ans++;
}
}
}
printf("%d\n",ans);
}
return 0;
}