0

So check50 says everything is right except for the handling of a height of 0. If you type 0, my program asks you for the height again. Check50 says this is not the correct handling?

Here's a screenshot with a small part of the code and the outputs (copy/paste from/to the appliance wasn't working):

http://postimg.org/image/dat95cg6b/

1

In order to pass check50, your output should mirror the staff implementation as close to exact as possible (in terms of output). Your code does not handle a pyramid of height 0 appropriately. Play around with the staff implementation a bit to give yourself some more ideas; you're almost there.

1
  • I assumed if the user pressed 0 you had to ask them for new integer. I ran the mario done by the cs50 staff and typed 0 and it just does nothing. So now in the do-while loop I changed the 1 to a 0 and check50 says its 100% correct. – 3231231 Mar 10 '15 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .