Submission

Status:
PPPPP

Score: 100

User: akuyga1

Problemset: หินงอก

Language: c

Time: 0.002 second

Submitted On: 2024-10-08 15:33:30

#include <stdio.h>

int main() {
    int N;
    scanf("%d",&N);
    int A[N],max=0;
    for(int i=0;i<N;i++){scanf("%d",&A[i]);if(A[i]>max)max=A[i];}
    for(int y=0;y<max;y++){
        for(int i=0;i<N;i++){//tell the ith of pole
        {for(int x=0;x<A[i];x++){
            if(x==y)printf("\\");
            else printf(" ");
         //descending   
        }
        for(int x=0;x<A[i];x++){
            if(x==A[i]-y-1)printf("/");
            else printf(" ");
         //ascending   
        } 
        }
}
        printf("\n");
    }
    return 0;
}