Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: cheetah
Problemset: กังหันสี่ทิศ
Language: cpp
Time: 0.004 second
Submitted On: 2026-09-17 22:56:26
#include<bits/stdc++.h>
using namespace std;
int main () {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, x = 0;
cin >> n;
int c = 'A' + n - 1 , N = (2 * n) - 1;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
if (i == j or i + j == 2 * (n - 1)) {
cout << char(c);
}
else {
cout << ' ';
}
}
if (char(c) == 'A') {
x = 1;
}
if (x == 0) {
--c;
}
else {
++c;
}
cout << ' ';
for (int j = 0; j < N; ++j) {
if (i == j or i + j == 2 * (n - 1)) {
cout << '*';
}
else {
cout << ' ';
}
}
cout << "\n";
}
return 0;
}