3450 - A+B(基本输入输出3)
输入两个数A,B,输出A+B的值。
Input
多组数据:每组由两个整数(a和b)构成,a和b之间用空格隔开,每组输入单独占一行。
当输入为 0 0 时,输入结束。0 0这组数据不处理。
Output
对于每一组测试用例,输出齐对应的和,每组数据一行。
Examples
Input
1 2 3 4 10 20 0 0
Output
3 7 30
Solution 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; }