My program is wrong and i don't input the next variable input. Why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

My program is wrong and i don't input the next variable input. Why?

Input variable https://code.sololearn.com/cH83Uc7xct5F/?ref=app

23rd Apr 2020, 7:00 AM
Malick Diagne
Malick Diagne - avatar
2 Answers
+ 4
Use only one Scanner(System.in) object: Scanner sc = new Scanner(System.in); int i = sc.nextInt(); int j = sc.nextInt();
23rd Apr 2020, 7:21 AM
andriy kan
andriy kan - avatar
0
Don't create multiple Scanner objects using the same input stream (System.in).
23rd Apr 2020, 7:24 AM
ChaoticDawg
ChaoticDawg - avatar