0

This was regarding new drivers license code coach problem. I wasn't able to handle the input properly?

In the u can see the input consists of 3 parts , 1 st a string of my name, then no of agents available, lastly others who applied, i used getLine method of Scanner, for input handing, 1 st two worked for fine, but for last one it was just giving an string of single space irrespective of any input. Here the link to my solution, check help me how to solve this? https://www.sololearn.com/coach/18?ref=app Thanks in advance...

22nd Aug 2020, 4:28 PM
sai santhosh potnuru
sai santhosh potnuru - avatar
2 odpowiedzi
+ 1
The link you added is private, others can't see your solution.. So copy paste to code playground and share the link here... May be, you are reading in 2nd line only for other name after int input.. Use ReadLine method and convert to Integer type..
22nd Aug 2020, 4:31 PM
Jayakrishna 🇮🇳
0
Oh thanks got the problem solved, i used nextInt method for integrr input, and used nextLine method for next other values, but literally i was searching in the next line (2nd line), lol.. I used another nextLine so i got the correct one, thank you for pointing out
22nd Aug 2020, 4:56 PM
sai santhosh potnuru
sai santhosh potnuru - avatar