Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: Patn01Z
Problemset: กังหันสี่ทิศ
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-07 19:56:19
#include <iostream>
using namespace std;
int main(){
int N=0;
cin >> N;
for (int i=0; i<2*N-1; i++){
if(i<N-1){
for(int j=0;j<i;j++){
cout << " ";
}
cout << char('A'+N-1-i);
for(int j=0;j<2*N-2*i-3;j++){
cout << " ";
}
cout << char('A'+N-1-i);
for(int j=0;j<i;j++){
cout << " ";
}
}
else if (i==N-1)
{
for(int j=0;j<i;j++){
cout << " ";
}
cout << char('A');
for(int j=0;j<i;j++){
cout << " ";
}
}
else{
for(int j=0;j<2*N-2-i;j++){
cout << " ";
}
cout << char('A'+i-N+1);
for(int j=0;j<2*(i-N+1)-1;j++){
cout << " ";
}
cout << char('A'+i-N+1);
for(int j=0;j<2*N-2-i;j++){
cout << " ";
}
}
cout << " ";
if(i<N-1){
for(int j=0;j<i;j++){
cout << " ";
}
cout << "*";
for(int j=0;j<2*N-2*i-3;j++){
cout << " ";
}
cout << "*";
for(int j=0;j<i;j++){
cout << " ";
}
}
else if (i==N-1)
{
for(int j=0;j<i;j++){
cout << " ";
}
cout << "*";
for(int j=0;j<i;j++){
cout << " ";
}
}
else{
for(int j=0;j<2*N-2-i;j++){
cout << " ";
}
cout << "*";
for(int j=0;j<2*(i-N+1)-1;j++){
cout << " ";
}
cout << "*";
for(int j=0;j<2*N-2-i;j++){
cout << " ";
}
}
cout << '\n';
}
return 0;
}