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
问题链接:https://vjudge.net/problem/HDU-1106
问题简述:实现A+B,多次输入多次输出
问题分析:利用输入作为while循环开始的条件,实现多次输入与输出,然后注意题目要求的格式,最后输出记得endl。
下面为已AC过的代码:
#include<iostream>
#include<string>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)//实现多次输入
{
int c=a+b;
cout<<c<<endl;//格式!
}
}