F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39655042_9966\Main.java:1: 错误: 解析时已到达文件结尾
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner input = new Scanner(System.in);while (true) {int x = input.nextInt();int y = input.nextInt();if (x == 0 && y == 0) {break;}boolean allPrimes = true;for (int n = x; n <= y; n++) { //调用isPrimeint value = n * n + n + 41;if (!isPrime(value)) {allPrimes = false;break;}}System.out.println(allPrimes ? "OK" : "Sorry");}}//判断是否素数public static boolean isPrime(int num) {for (int i = 2; i <= num/2; i++) {if (num % i == 0) {return false;}}return true;}}
                                                                                                                                                                                                                                                                             ^
0_0_39655042_9966\Main.java:1: 错误: 解析时已到达文件结尾
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner input = new Scanner(System.in);while (true) {int x = input.nextInt();int y = input.nextInt();if (x == 0 && y == 0) {break;}boolean allPrimes = true;for (int n = x; n <= y; n++) { //调用isPrimeint value = n * n + n + 41;if (!isPrime(value)) {allPrimes = false;break;}}System.out.println(allPrimes ? "OK" : "Sorry");}}//判断是否素数public static boolean isPrime(int num) {for (int i = 2; i <= num/2; i++) {if (num % i == 0) {return false;}}return true;}}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
2 个错误


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-15 02:49:27, Gzip enabled