#include<stdio.h>
int main (void)
{
int arr[81];int len =0;int a, b, max, height, i=0;
while(a != EOF){
a = scanf("%d", &b);
if( a == EOF){
break;
}
// creates array of integers
arr[i] = b;
i++;
}
//finds the largest integer
height = arr[0];
for(int y =1; y < i; y++){
if( arr[y] > height ){
height = arr[y];
}
}
max = height;
// does the thing
for( int x =0; x< height; x++){
for( int k =0; k<i; k++){
if(arr[k] < max){
putchar(' ');
} else {
putchar('#');
}
}
putchar('\n');
max--;
}
return 0;
}
No comments:
Post a Comment