Demo02一千以内的水仙花数
package 习题集2;
//1000以内的水仙花数
public class Demo02 {
public static void main(String[] args) {
int i = 100;
while (i < 1000){
int a = i / 100 % 10;
int b = i / 10 % 10;
int c = i / 1 % 10;
if (a * a * a + b * b * b + c * c * c == i){
System.out.println(i);
}
i ++;
}
}
}