java水仙花程序

public class sxhs01 {
public static void main(String[] args) {
System.out.println("程序开始");
for (int i =100; i <=999; i++){
int ge = i % 10;
int shi = i /10 % 10;
int bai = i / 10 / 10 % 10;
if (ge*ge*ge + shi*shi*shi + bai*bai*bai == i){
System.out.println(i);
}
}
System.out.println("程序结束");
}
}

你可能感兴趣的:(java,开发语言,算法)