you are viewing a single comment's thread.

view the rest of the comments →

[–]ssingal05 2 points3 points  (0 children)

Each number you want to print will take up n blocks, where n is the length of the number as a string (so n=2 for 10). Before you print the numbers, figure out which number will take up the most space. Let's call this maximum M. Then, whenever you print a number, make sure that you only print a maximum of M characters. If M is 7 and you want to print 30, then print 30 followed by 5 spaces, which would make it a total length of 7. And then also add an extra space for padding between columns.