Submission
Status:
-----
Subtask/Task Score:
0/100
Score: 0
User: 38408
Problemset: กังหันสี่ทิศ
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-04 22:00:16
#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<< " ";
}
}
for (int j = 0; j < n; j++)
{
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;
}
}