A + B Problem
hdu-1000
问题:
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
Sample Input
1 1
Sample Output
2
问题简述:
计算A+B,并输出结果。
问题分析:
当有输入时,就计算A+B,否则跳出循环。
AC的c++程序代码:
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
while (cin >> a >> b)
{
c = a + b;
cout << c << endl;
}
return 0;
}