Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: speed_coding
Problemset: หินงอก
Language: cpp
Time: 0.005 second
Submitted On: 2026-09-29 18:13:36
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int length[20];
int maxlength = 0;
for(int i = 0; i < n; i++){
cin >> length[i];
if(length[i] > maxlength){
maxlength = length[i];
}
}
for(int row = 0; row < maxlength; row++){
for(int i = 0; i < n; i++){
if(row < length[i]){
for(int j = 0; j < row; j++){
cout << " ";
}
cout << "\\";
for(int j = 0; j < 2 * (length[i] - 1 - row); j++){
cout << " ";
}
cout << "/";
for(int j = 0; j < row; j++){
cout << " ";
}
}
else{
for(int j = 0; j < 2 * length[i]; j++){
cout << " ";
}
}
}
cout << "\n";
}
}