+ 1
It's ok when I ain't entering p and s but when I enter p and s it is also showing invalid character
2 odpowiedzi
+ 5
I see. Scanner nextInt() does not read the newline input when you press enter (or in the case of Code Playground, when you submit multiple input on different lines). What you can do, is to put a dummy nextLine() call after you are done calling nextInt().
a=csk.nextInt();
b=csk.nextInt();
c=csk.nextInt();
csk.nextLine(); // this will consume the newline
+ 2
Thankyou very much