Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: 38408

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-04 22:10:37

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    for (int i = 0; i < 2*n-1; i++)
    {
        for (int j = 0; j < 2*n-1 ;j++)
        {
            int x = 0;
            if(j<n){
                x = n-j-1;
            }else{
                x = j-n+1;
            }
            if(i==j){
                cout << char('A'+ x);
            }else if(i+j==2*n-1-1){
                cout << char('A'+ x);
            }else{
                cout<< " ";
            }
        }
        cout<<" ";
        
        for (int j = 0; j < 2*n-1 ;j++)
        {
            if(i==j){
                cout << "*";
            }else if(i+j==2*n-1-1){
                cout <<"*";
            }else{
                cout<< " ";
            }
        }
        cout <<endl;
        
        
    }
    




}