Can someone explain dis great piece of JAVA IO??

Problem Link: http://www.codechef.com/MARCH14/problems/PROSUM/

Problem Solution by some gr8 Java Programmer: http://www.codechef.com/viewsolution/3505991

Please do try to provide an elaborated answer to how IO is achieved in the Solution.

Regards,
Akash Nigam.
(UP, India)

Waiting…:expressionless:

In few words: they are reading input char by char and utilized this approach to be used easily - readInt(), readString().

The goal is to have as quick reading as possible, on the other hand the code is not sensitive to such cases when line containing int contains also white spaces at the end (similar to C scanf() ).

1 Like

thanks @betlsita