Submission
Status:
PPPPP
Score: 100
User: www._.
Problemset: กังหันสี่ทิศ
Language: cpp
Time: 0.002 second
Submitted On: 2025-03-02 10:03:31
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
int N = n*2-1;
int y;
for(int i=0; i<N ; i++) {
y = n-i-1 ;
if (y<=0){
y = y*-1;
}
for(int j=0; j<N ; j++)
if(j==i||j+i==N-1){
cout << char('A'+y);
}
else{
cout << " ";
}
cout << " ";
for(int j=0; j<N ; j++)
if(j==i||j+i==N-1){
cout << "*";
}
else{
cout << " ";
}
cout << endl;
}
}