Submission

Status:

PPPPPPPPPPP

Score: 100

User: putter16488

Problemset: ฝุ่นธุลีล้อมดาว

Language: cpp

Time: 0.121 second

Submitted On: 2024-11-15 18:40:52

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

int main(){
	int n,d,check1,check2;
	cin>>n;
	if(n==1){
		printf("*");
		return 0;
	}
	check1=n-1;
	check2=check1;
	for(int i=0;i<(n*2)-1;i++){
		for(int j=0;j<(n*2)-1;j++){
			if(i==n-1){
				if(i==n-1&&j==n-1) printf("*");
				else{
					printf("+");
				}
			}
			else if(i<n-1){
					if(j>=check1&&j<=check2){
					printf("+");
				}
				else{
					printf("-");
				}
			}
			else if(i>n-1){
					if(j>=check1&&j<=check2){
					printf("+");
				}
				else{
					printf("-");
				}
			}
		}
		if(i>n-1){
			check1++;
			check2--;
		}
		if(i==n-1){
			check1++;
			check2--;
		}
		if(i<n-1){
			check1--;
			check2++;
		}
		printf("\n");
	}
}