Multiple inputs dont work in my code on "CODE PLAYGROUND" | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Multiple inputs dont work in my code on "CODE PLAYGROUND"

Can someone help me realize multiple inputs in my code (https://code.sololearn.com/cigHoiGI6Xip). Maybe I made some mistake in code. Spliting inputs on different lines dont work in my case. FOr example: first line - I entered "5" second line - I entered "10" Inputs from first line is work, but second value have null value. Thank you in advance.

3rd Jul 2019, 6:52 PM
Дима Лебедев
Дима Лебедев - avatar
3 Antworten
+ 1
The issue is the fact that you have two scanner objects. That won’t effectively compute on an online compiler. To make it work: Remove the declaration of the second scanner named “sc” and use your first scanner object named “scanner” for both blocks (you’ll need to move the declaration of “scanner” outside of the method body, like to the top of the password class for example)
3rd Jul 2019, 7:33 PM
Jake
Jake - avatar
+ 3
Thank you, Jake! Your advice help me. Now everithing works.
5th Jul 2019, 6:13 PM
Дима Лебедев
Дима Лебедев - avatar
+ 1
Please put the link to your code in the body of your question. If it is in the tags we cannot use the link.
3rd Jul 2019, 7:31 PM
sneeze
sneeze - avatar