原题网址:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1000
A + B Problem | ||||||
| ||||||
Description | ||||||
Calculate a + b | ||||||
Input | ||||||
The input will consist of a series of pairs of integers a and b (0 <= a, b <= 1000),separated by a space, one pair of integers per line. Process to the end of file. | ||||||
Output | ||||||
For 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 Input | ||||||
1 2 2 3 | ||||||
Sample Output | ||||||
3 5 |
最最基础的提交题,一般作为尝试性提交的第一题,注意多组输入的写法。
#include<stdio.h>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b) != EOF){
printf("%d\n",a+b);
}
return 0;
}