I use this try catch method but although this method removes NZEC , it does not provide any solution at all .Please resolve this issue someone.
Thanks, itās working now. I guess javaās still tryna catch itself!
yeah both the answers are coming as wrong, it is very weird.
This post was flagged by the community and is temporarily hidden.
am too not able to submit my java codeā¦getting NZEC error
I used try catch and fast I/O methods too
Before using nextInt() , use sc.hasNext()
inside if and true accept input and initialise every variable with default values
For example
int g = 0
if( sc.hasNext())
{
g = sc.nextInt();
}
// proceed using g
It helpedā¦man
Yaa ā¦ U are correct
IN JAVA,
if ur error is in line where u take input then try in this format ,
Scanner sc=new Scanner(System.in);
int takingInput=0;
if(sc.hasNextInt()){
takingInput= sc.nextInt();
}