A+B 4

你的任务是计算 a + b。

Input

输入包含多组数据。 每组数据包含一对整数 a 和 b 且位于一行。 包含0 0的数据表示输入结束,并且不处理该组数据。 
Output

对于每组 a 和 b,在一行内输出 a 与 b 的和。每组输入都要输出一行。 
Sample Input

1 5
10 20
0 0

Sample Output

6
30
#include<iostream>
using namespace std;
int main()
{
	int a,b,c;
	while(cin>>a>>b)
	{
	    if(a+b!=0)
	    cout<<a+b<<endl;
	}
	return 0;
}

 

 加一个判断如果输入加起来是0就不输出。
posted @ 2020-01-29 11:36  heroin1  阅读(194)  评论(0)    收藏  举报