Submission
Status:
[PPPPPPPPP]
Score: 100
User: akuyga1
Problemset: ภูเขา
Language: c
Time: 0.001 second
Submitted On: 2024-09-29 12:50:31
#include<stdio.h>
int main(){
int h=0;
int n;
scanf("%d",&n);
int store[n];
for(int i=0;i<n;i++){
scanf("%d",&store[i]);
if(store[i]>h)h=store[i];
}
//like x-h y-k every mountain have difference starting point
/*for(int y=h;y>=1;y--){
for(int x=1;x<=h;x++){
if(x==y){printf("/");}
else{printf(".");}
}
for(int x=h+1;x<=2*h;x++){
int o=x-h;
if(o==h-y+1)printf("\\");
else{printf(".");}
}
printf("\n");
*/ //prototype
for(int y=h;y>=1;y--){
for (int i=0;i<n;i++){
for(int x=1;x<=store[i];x++){
if(x==y){printf("/");}
else{printf(".");}}
for(int x=store[i]+1;x<=2*store[i];x++){
int o=x-store[i];
if(o==store[i]-y+1)printf("\\");
else{printf(".");}
}
}
printf("\n");
}
return 0;
}