題目描述:
輸入兩個數A,B,輸出A+B的值。
輸入:
多組數據:每組由兩個整數(a和b)構成,a和b之間用空格隔開,每組輸入單獨佔一行。
當輸入爲 0 0 時,輸入結束。0 0這組數據不處理。
輸出:
對於每一組測試用例,輸出齊對應的和,每組數據一行。
樣例輸入:
1 2
3 4
10 20
0 0
樣例輸出:
3
7
30
代碼:
#include <iostream>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)
{
if(a==0&&b==0)
{
exit(0);
}
else
{
cout<<a+b<<endl;
}
}
return 0;
}