How to stop reading multiple lines from stdin using Scanner?
问题 I'm working on an JAVA assignment should process multiple lines of input. The instructions read "Input is read from stdin." An example of sample input is given: one 1 two 2 three 3 I don't understand what the above sample input "read from stdin" means. Here's a test program I wrote that isolates my confusion: import java.io.*; import java.util.Scanner; class Test { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); while(stdin.hasNextLine()) { String line = stdin