Submission

Status:

PPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: anonymous

Problemset: ออลสปาร์ค

Language: cpp

Time: 0.138 second

Submitted On: 2026-10-20 15:46:04

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

int main(){
    int n; cin >> n;
    int c = 2*n - 1, x = 1;

    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=c;j++) cout << '-';
        for(int j=1;j<=x;j++) cout << '*';
        for(int j=1;j<=c;j++) cout << '-';
        x += 2;
        c--;
        cout << '\n';
    }

    c = n - 1;
    x = 1;
    int p = 1;

    for(int i=1;i<n;i++)p += 2;

    for(int i=1;i<=n;i++){
        for(int j=1;j<=c;j++)cout << '-';
        for(int j=1;j<=x;j++)cout << '*';
        for(int j=1;j<=p;j++)cout << '+';
        for(int j=1;j<=x;j++)cout << '*';
        for(int j=1;j<=c;j++)cout << '-';
        p -= 2;
        x += 2;
        c--;
        cout << '\n';
    }
    return 0;
}