How to stop reading multiple lines from stdin using Scanner?

后端 未结 4 1970
暗喜
暗喜 2021-02-06 05:28

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:

4条回答
  •  野的像风
    2021-02-06 05:42

    You could also put your values in a file e.g. input.txt and do:

    java Test < input.txt
    

提交回复
热议问题