How to solve this? Any help would be appreciated :S
http://img684.imageshack.us/img684/5099/xxxxxxl.jpg
Printable View
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?
Work hard, be good to your mother and maybe one day you will learn the value of doing your own homework.Quote:
Any help would be appreciated :S
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.