0_0_33256312_23530\Main.java:2: 错误: 类ACM2028是公共的, 应在名为 ACM2028.java 的文件中声明
public class ACM2028 { static long gcd(long a, long b) { long r = a % b; while (r != 0) { a = b; b = r; r = a % b; } return b; } static long lcm(long a, long b) { return a * b / gcd(a, b); } public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int n = in.nextInt(); long result = 1; for (long i = 0; i < n; i++) { long num = in.nextLong(); result = lcm(result, num); } System.out.println(result); } }}
^
1 个错误
|