# 冠翔訓練1005  ##### 輸入說明 測試資料只有一行,有兩個數字 n 及 m, 其值為 1 至 1000 的整數,表示黑色的屋瓦有 n 行及 m 列。 這兩個數字之間用空格(white space)隔開。 ##### 輸出說明 輸出資料為一個正整數,表示白色屋瓦有幾塊。 範例輸入 #1 ##### 範例輸入一: 1 3 ##### 範例輸入二: 2 3 範例輸出 #1 ##### 範例輸出一: 14 ##### 範例輸出二: 25 ```cpp= #include<iostream> #include<bits/stdc++.h> using namespace std; int m,n,a,b,c; int main() { while(cin>>m>>n){ a = m-1 ; b = n-1 ; c = 6+b*4+a*5+a*b*3; cout<<c ; } return 0 ; } ``` 
×
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