Submission

Status:

-----

Subtask/Task Score:

0/100

Score: 0

User: limsan

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-06-10 20:23:52

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int x = 0;
    cin >> x;
    for (int i = 0; i < x; i++)
    {
        for (int j = 0; j < i; j++)
            cout << " ";
        cout << char(64 + x - i);
        for (int j = 0; j < ((x - 1 - i) * 2) - 1; j++)
        {
            cout << " ";
        }
        if (i != (x - 1))
        {
            cout << char(64 + x - i);
        }
        for (int j = 0; j < i; j++)
            cout << " ";
        for (int j = 0; j < i; j++)
            cout << " ";
        cout << '*';
        for (int j = 0; j < ((x - 1 - i) * 2) - 1; j++)
        {
            cout << " ";
        }
        if (i != (x - 1))
        {
            cout << '*';
        }
        for (int j = 0; j < i; j++)
            cout << " ";

        cout << "\n";
    }
    for (int i = 0; i < (x - 1); i++)
    {
        for (int j = 0; j < (x - 2 - i); j++)
        {
            cout << " ";
        }
        cout << char(66 + i);
        for (int j = 0; j < (i * 2) + 1; j++)
            cout << " ";
        cout << char(66 + i);
        for (int j = 0; j < (x - 2 - i); j++)
        {
            cout << " ";
        }
        for (int j = 0; j < (x - 2 - i); j++)
        {
            cout << " ";
        }
        cout << '*';
        for (int j = 0; j < (i * 2) + 1; j++)
            cout << " ";
        cout << '*';
        for (int j = 0; j < (x - 2 - i); j++)
        {
            cout << " ";
        }
        cout << "\n";
    }
    return 0;
}