/*
* 打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。
* 例如:153 是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。
* */
public class test2 {
public static void main(String[] args) {
// TODO 自动生成的方法存根
int a=0,b=0,c=0,d=0;
for(int n=100;n<1000;n++)
{
a=n/100;
b=n%100/10;
c=n%100%10;
d=a*a*a+b*b*b+c*c*c;
if(n==d){
System.out.println(n);
}
}
}
}