0_0_39656810_7677.cpp:1:1: error: expected unqualified-id before 'public'
1 | public class PrimeExpressionChecker { public static boolean isPrime(int num) { if (num < 2) { return false; } for (int i = 2; i * i <= num; i++) { if (num % i == 0) { return false; } } return true; } public static void checkExpression(int x, int y) { boolean allPrime = true; for (int n = x; n <= y; n++) { int expressionValue = n * n + n + 41; if (!isPrime(expressionValue)) { allPrime = false; break; } } if (allPrime) { System.out.println("OK"); } else { System.out.println("Sorry"); } } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (true) { int x = scanner.nextInt(); int y = scanner.nextInt(); if (x == 0 && y == 0) { break; } checkExpression(x, y); } }}
| ^~~~~~
|