Receive this “runtime error (NZEC)” when send code to check. When compiling this code on my computer it works. Please, help.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;class Main
{
public static void main (String[] args) throws java.lang.Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Scanner src = new Scanner(System.in);
Main obj = new Main();
int t, i, a;
String input;
int[] intArray;t = src.nextInt(); if (t > 10) { System.exit(0); } for (i = 0; i < t; i++) { input = reader.readLine(); String[] strArray = input.split(" "); intArray = new int[strArray.length]; for (int k = 0; k < strArray.length; k++) { intArray[k] = Integer.parseInt(strArray[k]); } for (a = 0; a < 1; a++) { if (intArray.length == 1) { continue; } else if (intArray[a] >= 1 && intArray[a] <= 1000000000000000L && intArray[a + 1] >= 1 && intArray[a + 1] <= 1000000000000000L && intArray[a + 1] - intArray[a] <= 1000000000000000L && intArray[a] <= intArray[a + 1]) { obj.prime(intArray[a], intArray[a + 1]); } else { System.exit(0); } } } } void prime(long m, long n) { long j, k; long c; if (m == 1) { m++; } for (j = m; j <= n; j++) { c = 0L; for (k = 2; k <= j / 2; k++) { if (j % k == 0L) { c++; } } if (c == 0L) { System.out.println(j); } }
}
}
created
last reply
- 1
reply
- 906
views
- 2
users
- 1
link