neuq.oj 1003

题目描述:
输入两个数A,B,输出A+B的值。

输入:
多组数据:每组由两个整数(a和b)构成,a和b之间用空格隔开,每组输入单独占一行。

当输入为 0 0 时,输入结束。0 0这组数据不处理。

输出:
对于每一组测试用例,输出齐对应的和,每组数据一行。


样例输入:
1 2
3 4
10 20
0 0
样例输出:
3
7
30


c++代码:

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

猜你喜欢

转载自blog.csdn.net/stupid_dernier/article/details/80365207