#include<stdio.h>
intmain()
{
inti,a,b,c;
printf("請輸入一個(gè)3位數(shù):");
scanf("%d",&i);
a=i%10;
b=i/10%10;
c=i/100;
if(i==a*a*a+b*b*b+c*c*c)
printf("%d是水仙花數(shù)\n",i);
else
printf("%d不是水仙花數(shù)\n",i);
return0;
}
#include<stdio.h>
intmain()
{
inti,a,b,c;
printf("請輸入一個(gè)3位數(shù):");
scanf("%d",&i);
a=i%10;
b=i/10%10;
c=i/100;
if(i==a*a*a+b*b*b+c*c*c)
printf("%d是水仙花數(shù)\n",i);
else
printf("%d不是水仙花數(shù)\n",i);
return0;
}