【ACM】ACM steps 1.1.1

从今天开始做steps上面的题目了。大体看了一下难度,感觉不是很难,现在都是一些A+B的题目,争取一次过掉。把源码发在这里,再写几句解题心得什么的……

1.1.1A+B for Input-Output Practice (I)

 

Problem Description

Your 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.

 

 

Input

The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.

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 5

10 20

Sample Output

6

30

Author

lcy
参考代码:

#include
 int main()
 {
    int a,b;
   while(scanf("%d%d",&a,&b)!=EOF)
   printf("%dn",a+b);
 }

 

最简单的题目了,没什么好说的,注意while语句后面不要加分号,一开始居然错在这上面了………………

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注