Here's a hint:

The problem statement explicitly calls for column displays. And it appears to require the columns to correspond directly to the numbers entered. So you cannot reorder the numbers into ascending order or anything.

Therefore, make a 2-d array of chars, and fill it with either stars or spaces. Then you can quickly output the array without worrying about what it contains, whether it is too high or too low, or anything like that.

This lets you separate out the "printing" from the "computing." It should make things easier for you.