Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: qweqwe

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-06-13 20:48:39

#include <bits/stdc++.h>
#define speed cin.tie(0)->sync_with_stdio(0)
using namespace std;

int main(){
	speed;
	int n;cin >> n;
	int ind=n-1;
	const int c=(2*n-1);
	for (int i=0;i<c;i++){
		for (int j=0;j<(4*n-1);j++){
			if (j<c){
				if (i==j || i+j==c-1){
					char temp='A'+ind;
					cout << temp;
				}else cout << " ";
			}else if (j==c){
				cout << " ";
			}else{
				if (c+i+1==j || i+j==2*c){
					cout << "*";
				}else cout << " ";
			}
		}
		if (i<n-1) ind--;
		else ind++;
		cout << "\n";
	}
	return 0;
}