問題網址:https://www.hackerrank.com/challenges/java-end-of-file/problem
問題重點:
Scanner.hasNext() Returns true if this scanner has another token in its input.
Scanner.hasNextLine() Returns true if there is another line in the input of this scanner.
while(boolean)迴圈使用

因hasNext最後一行為false故不進迴圈,再加印一個最後一行。