提交时间:2023-08-24 16:39:58
运行 ID: 100083
#include<bits/stdc++.h> using namespace std; int main(){ int a[10] = {6,2,5,5,4,5,6,3,7,6}; int n; scanf("%d",&n); int cnt = 0; for(int i = 0;i < 10;i++){ for(int j = 0;j < 10;j++){ if(a[i] + a[j] + a[i+j] == n-4){ cnt++; }else if(a[i] + a[j] + a[(i+j)%10] + a[(i+j)/10] == n-4){ cnt++; } } } printf("%d",cnt); return 0; }