+ 4

Experimenting with getting input in java

I have modified SoloLearn example for getting input in java as follows. But it does not work. What is the source of error? https://code.sololearn.com/ck0SxAe8gfUX/?ref=app

18th Jul 2017, 10:15 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
3 Respostas
+ 6
try inputting this: 5 6 0 The error is that Sololearn only supports one input from the user at a time. So when the program needs multiple inputs, you'll need to write each input on a new line
18th Jul 2017, 10:33 PM
Limitless
Limitless - avatar
+ 4
Your program will crash if there is no 0 in the input, as it's an infinite loop. Make sure you have a 0.
18th Jul 2017, 10:46 PM
Rrestoring faith
Rrestoring faith - avatar
+ 4
Thanks Limitless!
18th Jul 2017, 10:49 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar