# 簡易加法 https://zerojudge.tw/ShowProblem?problemid=a002 ### 內容 請寫一個程式,讀入兩個數字,並求出它們的和 ### 輸入說明 每組輸入共一行,內含有兩個整數 a, b 以空白隔開,a, b絕對值皆小於 106 ### 輸出說明 對於每組輸入,輸出該兩整數的和 ### 範例輸入輸出 #### 範例輸入 1 ``` 5 10 ``` #### 範例輸出 1 ``` 15 ``` #### 範例輸入 2 ``` 1 2 ``` #### 範例輸出 2 ``` 3 ``` # Code ```cpp #include<iostream> using namespace std; int main(){ int a = 0, b = 0; //建議盡早養成宣告變數時初始化的習慣 cin >> a; cin >> b; cout << a + b; } ``` ###### tags: `基本輸入輸出` `IO` `基本四則運算`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up