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
问题分析:
做加法运算,但要注意此程序可以无限输入输出结果。
#include <iostream>
using namespace std;
void main()
{
int a, b;
while (cin >> a >> b)
cout << a + b << endl;
}