Jump to content


Integer Pyramid Help


  • Please log in to reply
1 reply to this topic

#1 Manatee

Manatee

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 18 February 2012 - 09:57 AM

Hey guys.

So I need to make a pyramid from a series of integers using a for-statement
My results are:

1
212
32123
4321234
543212345
65432123456
7654321234567

All I need is a result that makes it look like a pyramid.

can anyone help me align it? Thanks.

#2 Kraicheck

Kraicheck

    Advanced Member

  • Members
  • PipPipPip
  • 879 posts
  • Gender:Male
  • Location:Belgium

Posted 18 February 2012 - 04:53 PM

You need to add spaces before your numbers.
I leave it up to you to figure out how many spaces you need in front of every row.