打印三位数水仙花数

public class TestShui{

public static void main(String[] args){

for(int i=100;i<1000;i++){

if(i==(i/100)*(i/100)*(i/100)+(i%100/10)*(i%100/10)*(i%100/10)+(i%10)*(i%10)*(i%10)){
System.out.println(i);
}
}

}
}

posted @ 2018-05-18 21:11  火丶日月明  阅读(167)  评论(0编辑  收藏  举报