public class unit3_8 {
public static void main(String[] args) {
judge();
}
private static boolean Narc_num(int n) {
int g, s, b;
int g3, s3, b3;
g = n % 10;
s = n / 10 % 10;
b = n / 100;
g3 = g * g * g;
s3 = s * s * s;
b3 = b * b * b;
if (b3 + s3 + g3 == n)
return true;
else
return false;
}
public static void judge() {
for (int i = 100; i <= 999; i++) {
boolean n = Narc_num(i);
if (n) {
System.out.printf("%d\t", i);
}
else {}
}
}
}
11-03