We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
try it :-
scan.nextLine();
after double
so that when the next line is entered that contains string can be taken into the input buffer otherwise the double is continued for the next and it doesn't find the double value intead it's a string .It depends on editor also
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Stdin and Stdout II
You are viewing a single comment's thread. Return to all comments →
try it :- scan.nextLine(); after double so that when the next line is entered that contains string can be taken into the input buffer otherwise the double is continued for the next and it doesn't find the double value intead it's a string .It depends on editor also