0
That's odd task error. Java.
This code works in IDEA, but not here. I don't know where is mistake. https://code.sololearn.com/cioI8oBhHxCs
2 Antworten
+ 3
seems that (at least) sololearn java compiler doesn't support more than one instance of Scanner...
remove 'scanner1' declaration/initialization and replace it by scanner in 'console' assignement (inside loop): that will your code work here... if expected result was sum of even numbers (divisble by 2) ^^
+ 1
Why you are using two Scanner object you can use same Scanner for all user input..
And when i remove second scanner from your code it works fine.