0_0_15752754_170\Main.java:1: 错误: 类text2006是公共的, 应在名为 text2006.java 的文件中声明
package dancishu.java;import java.util.Scanner;public class text2006 { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int i = sc.nextInt(); int j = sc.nextInt(); text1(i, j); } public static void text1(int m, int n) { int sum = 0; if (100 <= m && m <= n && n <= 999) { for (int x = m; x <= n; x++) { int a = x / 1 % 10; int b = x / 10 % 10; int c = x / 100 % 10; if (x == a * a * a + b * b * b + c * c * c) { sum++; System.out.println(x); } } if (sum==0) { System.out.println("no"); } } else { System.out.println("no"); } }}
^
1 个错误
|