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.
3 ответов
+ 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)
+ 3
Thank you, Jake! Your advice help me. Now everithing works.
+ 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.