Skip to content

[ACM] a002: 簡易加法

加法運算

內容 :

請寫一個程式,讀入兩個數字,並求出它們的和。

輸入說明 :

每一組輸入有兩個整數(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;
}
Published inACM解題

Be First to Comment

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *