while 循环求所有水仙花数

while 循环求所有水仙花数

第1个回答  2017-12-05
while(x<1000)
{
a=x%10;
b=(x%100-a)/10;
c=(x-x%100)/100;
if(a*a*a+b*b*b+c*c*==x)

System.out.println(x); x++;

}本回答被网友采纳
相似回答