

/*5打印出所有"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该本身。例如:153是一个水仙花数,因为153=1^3+5^3+3^3。
#include"math.h"
main()
{int x=100:a,b,c;
while(x>=100&x<1000) {a=0.01*x;b=10*(0.01*x-a);c=x-100*a-10*b;
if(x==(pow(a,3)+pow(b,3)+pow(c,3))) Printf("%5d",x);x++;
}
*/
#include<stdio.h>
#include<math.h>
int main()
{
int x=100,a,b,c;
while(x>=100&&x<1000)
{
a=x/100;
b=x%100/10;
c=x-100*a-10*b;
if(x==(pow(a,3)+pow(b,3)+pow(c,3)))
printf("%5d",x);
x++;
}
printf("\n");
return 0;
}