+ 2
Why this code is not working?
according to m https://code.sololearn.com/cmTq7A0r08DW/?ref=app
4 Answers
+ 5
1. import not Import
2. System.in not system.in
3. You are trying to compare uage(Scanner type) with 18(int) it will not work. I changed it to show the algorithm need to be done. In this case you need to cast user input to string than to int
https://code.sololearn.com/cFy00DW7d496/?ref=app
+ 4
Look like you are currently correcting it, continue! Just remember that Scanner return your value with getInt so you have to store it! You only print it. You also compare directly integer with Scanner objet but you want instead compare it to your stored value! Good luck and be carefull with lower case letters ! (Import, system, next int, etc )
+ 3
I totally forget that scanner can return int :)
+ 2
never mind, your answer was really helpful.âș