#include <stdio.h>
int main()
{
int a,b,c,sum;
int n = 100;
for (;n < 999; n++)
{
a= n/100;
b = n/10%10;
c = n%10;
sum = a*a*a + b*b*b + c*c*c;
if ( n == sum)
{
printf("%d\n",n);
}
}
return 0;
}
水仙花数 指 三位数的3次 幂 数才成为水仙花数。
例如 ABC = A的3次方 + B 的3次方 + C的3次方
题目 : 输出100~999中所有的水仙花数。 例如 153 = 1 + 5*5*5 + 3*3*3;