題目描述
你的任務是計算a+b。
輸入
輸入中每行是一對a和b。其中會有一對是0和0標誌着輸入結束,且這一對不要計算。
輸出
樣例輸入
1 5
10 20
0 0
樣例輸出
6
30
#include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a||b){
cout<<a+b<<endl;
}
return 0;
}
你的任務是計算a+b。
輸入中每行是一對a和b。其中會有一對是0和0標誌着輸入結束,且這一對不要計算。
1 5
10 20
0 0
6
30
#include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a||b){
cout<<a+b<<endl;
}
return 0;
}
def convert_binary(num): result = [] if num <= 1: result.append(num) else: while True: