I'm stuck on the Mario part of PSet1. I've managed to write up my program and the output is always correct (or at least seems to be to me). I know it's definitely the loops that are making things difficult for me. Here isare my codeloops:
for (int i = 0; i < n; i++)
{
for (int a = 0; a < (n - (i + 1i+1));a++; a++)
{
printf(" ");
}
for (int b = 0; b <<= (i + 21); b++)
{
printf("#");
}
printf("\n");
}
It might be messy,The output looks exactly the same as I took some time to get my head around it, but so far the program has worked perfectly for me should. However, when I execute Check50, I get the following errors:
:() handlesmario.c exists
:) mario.c compiles
:) rejects a height of -1
:) handles a height of 0 correctly
:( handles a height of 1 correctly
\ expected output, but not "##\n"
:( handles a height of 2 correctly
\ expected output, but not " ##\n###\n"
:( handles a height of 23 correctly
\ expected output, but not " ##\n ..."
:) rejects a height of 24
:) rejects a non-numeric height of "foo"
:) rejects a non-numeric height of ""
I just don't understand what it wants from me.
I'd really appreciate some help! Thanks!