题目:打印出所有的 "水仙花数 ",所谓 "水仙花数 "是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个 "水仙花 数 ",因为153=1的三次方+5的三次方+3的三次方。

题目:打印出所有的 "水仙花数 ",所谓 "水仙花数 "是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个 "水仙花
数 ",因为153=1的三次方+5的三次方+3的三次方。
1 public class Algorithm_Game_03 {
2     public static void main(String[] args) {
3         for(int i = 100 ; i < 999 ; i++){
4             if(i==(i/100)*(i/100)*(i/100)+(i%100/10)*(i%100/10)*(i%100/10)+(i%10)*(i%10)*(i%10)){
5                 System.out.print(i+"=>");
6             }
7         }
8     }
9 }
原文地址:https://www.cnblogs.com/elleniou/p/3283233.html