Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: pakorn

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-05 10:43:19

#include <bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0)->sync_with_stdio(0);
	int n;
	cin >> n;
	int k=0,l=0;
	int i =0,j=0;
	while(i>=0)
	{
		j=0;
		l=0;
		while(j>=0)
		{
			if(i == j)cout << char('A' + n - i-1);
			else cout << ' ';
			if(l < n-1){j++;l++;}
			else j--;
		}
		cout  << ' ';
		j=0;
		l=0;
		while(j>=0)
		{
			if(i == j)cout << '*';
			else cout << ' ';
			if(l < n-1){j++;l++;}
			else j--;
		}
		if(k < n-1){i++;k++;}
		else i--;
		cout << '\n';
	}
	return 0;
}