Hi,
I am new to programming. I am stuck with NZEC error.
When i compile it locally it works fine. But in Codechef editor it gives me runtime error (NZEC). After introcing try catch block it gave me this error:
java.util.NoSuchElementException
Someone, please help me to resolve this issue.
import java.util.;
import java.lang.;
import java.io.*;
class Main {
public static void main(String[] args)throws java.lang.Exception {
Scanner obj = new Scanner(System.in);
try{
int n = obj.nextInt();
int val;
while(n-- > 0){
val = obj.nextInt();
int result = 1;
for(int i=1;i<=val;i++)
result = result * i;
System.out.println(result);
}
}catch(java.lang.Throwable t){
System.out.println(t);
}
}
}