CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2010
    Posts
    1

    Unhappy Help with writing a program to do this...

    How to solve this? Any help would be appreciated :S

    http://img684.imageshack.us/img684/5099/xxxxxxl.jpg

  2. #2
    Join Date
    Aug 2008
    Posts
    902

    Re: Help with writing a program to do this...

    Quote Originally Posted by Anubis_F View Post
    How to solve this? Any help would be appreciated :S

    http://img684.imageshack.us/img684/5099/xxxxxxl.jpg
    This sound eerily similar to a standard homework assignment...

    Since this is more to do with basic problem solving than it is programming, why don't you start off by telling us your approach to solving this. How would YOU solve this if it was an SAT or ACT question, and NOT related to programming?

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Help with writing a program to do this...


  4. #4
    Join Date
    Aug 2006
    Posts
    157

    Re: Help with writing a program to do this...

    Any help would be appreciated :S
    Work hard, be good to your mother and maybe one day you will learn the value of doing your own homework.

  5. #5
    Join Date
    May 2009
    Posts
    2,413

    Re: Help with writing a program to do this...

    Quote Originally Posted by Anubis_F View Post
    How to solve this? Any help would be appreciated
    You can convince yourself that the number of cans in a soda-triangle of size N consists of the sum of the numbers from 1 to N like,

    triangle(N) = 1 + 2 + 3 + ...... + N

    And a soda-pyramide of size N consists of the sum of soda-triangles from size1 to N like

    pyramide(N) = triangle(1) + triangle(2) + triangle(3) + ....... + triangle(N)

    Pyramide(N) can easily be calculated using two nested loops both going from 1 to N.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured