C++ : Checking if no Input is left to process

Правка en1, от scopeInfinity, 2016-12-29 17:41:09

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??

Теги c++, stdin, input

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский scopeInfinity 2016-12-29 17:54:39 11
en1 Английский scopeInfinity 2016-12-29 17:41:09 575 Initial revision (published)