Playing with a piece of Java which reads this from the console:
Normally, I'd have used a BufferedReader and recursed through each line with calls to readLine(), but it falls down on the last line because there's no carriage return after "-1".
Is there a better way that I'm missing?
Code:
475.6
11.9 27.4 14.98 6
102.0 99.9
220.0 132.9
256.3 147.9
275.0 102.9
277.6 112.9
381.8 100.9
516.3
15.7 22.1 20.87 3
125.4 125.9
297.9 112.9
345.2 99.9
-1
Normally, I'd have used a BufferedReader and recursed through each line with calls to readLine(), but it falls down on the last line because there's no carriage return after "-1".
Is there a better way that I'm missing?