Submission

Status:

-----

Subtask/Task Score:

0/100

Score: 0

User: tayakorn

Problemset: กังหันสี่ทิศ

Language: cpp

Time: 0.002 second

Submitted On: 2026-08-11 22:20:25

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <queue>
using namespace std;

#define io {ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0);}
#include <map>
int main() {
    io;
    int n;cin >> n;
    int startchar = 1, endchar = ((n - 1) * 2) + 1;
    for (int i = 1;i <= (n * 2) - 1;i++) {
        for (int j = 1;j <= (n * 2) - 1;j++) {
            if ((j == startchar or j == endchar) and i <= (n)) {
                cout << char(65 + ((n - i + 1) - 1));
            }
            else if ((j == startchar or j == endchar) and i > (n)) {
                cout << char(65 + (i - n));
            }
            else { cout << " "; }
        }
        for (int j = 1;j <= n;j++) {
            cout << " ";
        }
        for (int j = 1;j <= (n * 2) - 1;j++) {
            if ((j == startchar or j == endchar)) {
                cout << "*";
            }
            else { cout << " "; }
        }
        startchar += 1;endchar -= 1; cout << endl;
    }
}