Submission

Status:

-----

Subtask/Task Score:

0/100

Score: 0

User: fillhavertz

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-05 15:55:49

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    int size = 2 * n; // width

    for (int i = 0; i < size - 1; i++) {
        string line(size, ' '); // build a line of spaces
        int left = i, right = size - 2 - i;

        if (left >= 0 && left < size) line[left] = 'A' + abs(i + 1 - n);
        if (right >= 0 && right < size) line[right] = 'A' + abs(i + 1 - n);
        cout << line << '\n';

        // Second line (with stars)
        string line2(size, ' ');
        if (left >= 0 && left < size) line2[left] = '*';
        if (right >= 0 && right < size) line2[right] = '*';
        cout << line2 << '\n';
    }

    return 0;
}