提交时间:2023-08-24 10:47:44
运行 ID: 99944
#include <iostream> using namespace std; int num[10] = {6,2,5,5,4,5,6,3,7,6},n,len = 0; int getlen(int n){ int sum = 0; if(n == 0) return num[0]; while(n){ sum += num[n%10]; n /= 10; } return sum; } int main(){ cin >> n; n -= 4; for(int i=0;i<=1000;i++){ for(int j=i+1;j<=1000;j++){ if(getlen(i)+getlen(j)+getlen(i+j)==n) len += 2; } if(getlen(i)*2+getlen(i*2)==n) len++; } cout << len; return 0; }