#include<stdio.h>
#include<string.h>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<ctype.h>
#include<stack>
#include<math.h>
#include <string>
#include<algorithm>
#include<iomanip>
using namespace std;
int fun(int x)
{
int sum = 0;
int f[10] = {6,2,5,5,4,5,6,3,7,6};
while(x / 10 != 0)//两位数
{
sum += f[x % 10];
x = x / 10;
}
sum += f[x];
return sum;
}
int main()
{
int a,b,c,m,tsum = 0;
cin>>m;
for(a = 0;a <= 1111;a++)
for(b = 0;b <= 1111;b++)
{
c = a + b;
if(fun(a) + fun(b) + fun(c) == m - 4)
{
printf("%2d + %2d = %2d\n",a,b,c);
tsum++;
}
}
printf("共有%d个不同的等式",tsum);
return 0;
}
火柴
最新推荐文章于 2022-10-25 16:30:55 发布