My issue
your Question said give input when i am taking input s it is showing me this error Exception in thread “main” java.util.NoSuchElementException
at java.base/java.util.Scanner.throwFor(Scanner.java:937)
at java.base/java.util.Scanner.next(Scanner.java:1594)
at java.base/java.util.Scanner.nextInt(Scanner.java:2258)
at java.base/java.util.Scanner.nextInt(Scanner.java:2212)
at Codechef.main(Main.java:14)
this very bad management if there is a thing which should be remember at least you should mention
My code
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
int i;
Scanner sc =new Scanner(System.in);
if(sc.hasNextInt())
i=sc.nextInt();
System.out.print(i);
}
}
Problem Link: KGOOD Problem - CodeChef