Submission

Status:

-----

Subtask/Task Score:

0/100

Score: 0

User: cheeseycheese05

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-13 20:23:20

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    if (!(cin >> n)) return 0;
    
    int j = 0;
    // Top half
    for(int i = n - 1; i > 0; i--){ 
        cout << string(j, ' ') 
             << (char)('A' + i) 
             << string(2*(i-1), ' ') 
             << ' ' 
             << (char)('A' + i) 
             << string(2*j + n, ' ') 
             << '*' 
             << string(2*(i-1), ' ') 
             << " *" << '\n'; 
        j++;
    }
    
    // Middle single character line
    cout << string(j, ' ') << 'A' << string(2*j + n, ' ') << '*' << '\n';
    
    // Bottom half
    for(int i = 1; i < n; i++){ 
        j--; 
        cout << string(j, ' ') 
             << (char)('A' + i) 
             << string(2*(i-1), ' ') 
             << ' ' 
             << (char)('A' + i) 
             << string(2*j + n, ' ') 
             << '*' 
             << string(2*(i-1), ' ') 
             << " *" << '\n';
    }
    return 0;
}