Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: kenmuay

Problemset: หินงอก

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-12 21:31:44

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

int main(){
    int n;
    cin >> n;
    int arr[n];
    int max=0;
    for(int i=0; i<n; i++){
        int x;
        cin >> x;
        arr[i] = x;
        if(x>max) max=x;
    }
    for(int i=0; i<max; i++){
        for(int k=0; k<n; k++){
            if(arr[k]<=i){
                for(int j=0; j<arr[k]*2; j++){
                    cout << " ";
                }
                continue;
            }
            for(int j=0; j<arr[k]*2; j++){
                if(j==i) cout << "\\";
                else if(j+i==arr[k]*2-1) cout << "/";
                else cout << " ";
            }
        }
        cout << endl;
    }

    return 0;
}