Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

NoSuchElementException for nextInt

$
0
0

compiling below code gives an error, can someone help me in resolving this?

import java.util.*; import java.lang.*; import java.io.*; import java.util.Scanner;

/ Name of the class has to be "Main" only if the class is public. /
class Codechef
{
public static void main (String[] args)
{
int a,b;
Scanner input = new Scanner(System.in);
a=input.nextInt();
b=input.nextInt();
int diff = 0, output1 = 0, output2 = 0, diffDigits =0;
diff = a-b;
}
}


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>