3450 - A+B(基本输入输出3)
时间限制 : 1 秒
内存限制 : 128 MB
输入两个数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> #include<stdlib.h> using namespace std; int main(){ int a,b; while(cin>>a>>b){ if(a==0 && b==0) { exit(1); } else { cout<<a+b<<endl; } } return 0; }