I\'m getting runtime error (NZEC) when running the following code over at SPOJ. I\'d be very thankful if any of you would kindly point out what\'s going on.
For Java, NZEC is returned when the code throws an exception. For problems on Spoj, etc often the last line in the input causes this exception if the test cases are not terminated by an identifier string.
For such cases, a useful hack is to wrap your code in a try - catch and simply return if there's an exception. The caught exception signals that you've reached the end of input.
public static void main(String[] args) {
temp program = new temp();
try{
program.begin();
} catch(Exception e){
return;
}
}