0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-20 10:25:24 +00:00
OI-codes/XJOI/contest/21novice/A/A.cpp

67 lines
1.4 KiB
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
cout << ' ';
}
cout << '+';
for (int j = 1; j < 2 * n - 2 * i; j++) {
cout << ' ';
}
cout << '+' << endl;
}
for (int i = 0; i < n; i++) {
cout << ' ';
}
cout << '+' << endl;
for (int i = n - 1; i >= 0; i--) {
for (int j = 0; j < i; j++) {
cout << ' ';
}
cout << '+';
for (int j = 1; j < 2 * n - 2 * i; j++) {
cout << ' ';
}
cout << '+' << endl;
}
cout << endl;
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
cout << ' ';
}
cout << '+';
for (int j = 1; j < 2 * n - 2 * i; j++) {
cout << ' ';
}
cout << '+' << endl;
}
for (int i = 0; i <= n; i++) {
for (int j = 0; j < n; j++) {
cout << ' ';
}
cout << '+' << endl;
}
cout << endl;
for (int i = 0; i < n * 2; i++) {
cout << '+';
}
cout << endl;
for (int i = 1; i < n * 2; i++) {
cout << '+';
for (int i = 1; i < n * 2; i++) {
cout << ' ';
}
cout << '+' << endl;
}
for (int i = 0; i < n * 2; i++) {
cout << '+';
}
cout << endl;
return 0;
}