package com.hjx;
/**
- @author hjx
- @data 2021/1/21 - 12:07
*/
public class ForDemo5 {
public static void main(String[] args) {
// 通过for循环,找到所有的三位数的个位十位百位;
for (int i = 100; i < 1000; 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);
}
}
}
}