加法運算
內容 :
請寫一個程式,讀入兩個數字,並求出它們的和。
輸入說明 :
每一組輸入有兩個整數(int)
輸出說明 :
輸出該兩整數的和(int)
範例輸入 :
5 10
1 2
範例輸出 :
15
3
出處:http://zerojudge.tw/ShowProblem?problemid=a002
程式碼:
#include using namespace std; int main() { int a,b; while(cin>>a>>b) { cout<<a+b<<endl; } return 0; }
Be First to Comment