import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int i, j, n, m, a, b, c;
while (sc.hasNextInt()) {
m = sc.nextInt();
n = sc.nextInt();
for (i = m, j = 0; i <= n; i++) {
a = i / 100;
b = i / 10 % 10;
c = i % 10;
if (a * a * a + b * b * b + c * c * c == i) {
if (j > 0) {
System.out.print(" " + i);
} else {
System.out.print(i);
}
j++;
}
}
if (j == 0) {
System.out.print("no");
}
System.out.println();
}
}
}
杭电2010 ( 水仙花数 ) java
最新推荐文章于 2019-09-12 22:31:39 发布