Submission
Status:
-----
Subtask/Task Score:
0/100
Score: 0
User: speed_coding
Problemset: กังหันสี่ทิศ
Language: cpp
Time: 0.002 second
Submitted On: 2026-09-29 18:09:51
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int gap = 3;
for(int i= 0; i < 2*n - 1; i++){
int distance = i;
if((2*n)-2-i < distance){
distance = 2*n - 2 - i;
}
char letter = 'A' + (n-1-distance);
int c1 = distance;
int c2 = (2*n-2) - distance;
for(int col = 0; col < 2*n -1; col++){
if(col==c1|| col==c2){
cout << letter;
}
else{
cout << " ";
}
}
for(int i = 0; i < gap; i++){
cout << " ";
}
int max_col = c1 ;
if(c2 > max_col){
max_col = c2;
}
for(int col = 0; col <= max_col; col++){
if(col == c1 || col==c2){
cout << "*";
}
else{
cout << " ";
}
}
cout << "\n";
}
}