A Sea Battle

平移过后即外围的$(w_{2} + 2) \times  (h_{1} + h_{2} + 2)$的矩形周长;

1 #include<bits/stdc++.h>
2 using namespace std;
3 int main(){
4     int w1,w2,h1,h2;
5     cin>>w1>>h1>>w2>>h2;
6     int a=w1+2,b=h1+h2+2;
7     cout<<((a+b)<<1)-4<<endl;
8     return 0;
9 }
View Code

相关文章: