There are few problems in which we can't determine length of input. Program is meant to process all the input it is given and terminates after no input is left in stdin.
For Example
Problem : Print Sum in new line for every two integer in a line.
Sample Input —
5 6
10 15
3 4
Sample Output -
11
25
7
Similar Question on SPOJ
http://www.spoj.com/problems/NHAY/
What is a good way to handle this kind of Inputs??