Problem Description
Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
1 1
Sample Output
2Problem DescriptionYour task is to Calculate a + b. Too easy?! Of course! I specially designed the problem for acm beginners. You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.Sample Input1 5 10 20
Sample Output6 30如果 题目没有明确的标示量 用来停止输入或者 明确的指明输入多少情况 用while(——!=EOF)
while(scanf(“%d%d”,&a&b)!=EOF) 如果a和b成功读入,那么scanf的返回值就是2 如果只有a被成功读入,返回值为1 如果a和b都未被成功读入,返回值为0