HDUacm 1000 A + B Problem

2014-11-24 00:43:40 · 作者: · 浏览: 86

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
2


Code:
1 #include
2 main()
3 {
4 int A,B;
5
6 while(scanf("%d%d",&A,&B)!=EOF)
7 {
8 printf("%d\n",A+B);
9 }
10 }

Tips:
Process to end of file. //使用while循环,终止于EOF。
output A + B in one line. //printf需输出"/n"。

作者 任琦磊