#include <stdio.h>
#include <string.h>
int Multi(int x)
{
int i;
int re=1;
for (i = 1;i <= x;i++)
re *= i;
return re;
}
int main()
{
char ch[10];
while(scanf("%s", ch)!=EOF)
{
printf("%s,", ch);
int len = strlen(ch);
int i, sum = 0,s=0,c=1;
for (i = 1;i < len;i++)
c = c * 10;
for (i = 0;i < len;i++)
{
int x = ch[i] - '0';
s += x*c;
c = c / 10;
if (i != len - 1)
printf("%d!+", x);
else printf("%d!=", x);
sum += Multi(x);
}printf("%d\n", sum);
if (sum == s) printf("Yes\n");
else printf("No\n");
}
return 0;
}
阶乘数
最新推荐文章于 2020-04-15 10:07:03 发布