1. 程式人生 > >neuq.oj 1003

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; }