Skip to main content
added detail
Source Link
cursue
  • 35
  • 1
  • 8

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!

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 is my code:

for (int i = 0; i < n; i++)
{

for (int a = 0; a < (n - (i + 1));a++)
{
printf(" ");
}

for (int b = 0; b < (i + 2); b++)
{
printf("#");
}

printf("\n");
}

It might be messy, as I took some time to get my head around it, but so far the program has worked perfectly for me. However, when I execute Check50, I get the following errors:

:( 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             ..."

I just don't understand what it wants from me.

I'd really appreciate some help! Thanks!

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 are my loops:

for (int i = 0; i < n; i++)
{

for (int a = 0; a < (n - (i+1)); a++) 

{
printf(" ");
}

for (int b = 0; b <= (i + 1); b++)
{
printf("#");
}

printf("\n");
}

The output looks exactly the same as it should. However, when I execute Check50, I get the following:

:) mario.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'd really appreciate some help! Thanks!

added 24 characters in body
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

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 is my code:

for (int i = 0; i < n; i++)
{

for (int a = 0; a < (n - (i + 1));a++)
{
printf(" ");
}

for (int b = 0; b < (i + 2); b++)
{
printf("#");
}

printf("\n");
}

It might be messy, as I took some time to get my head around it, but so far the program has worked perfectly for me. However, when I execute Check50, I get the following errors:

:( 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 ..."

:( 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             ..."

I just don't understand what it wants from me.

I'd really appreciate some help! Thanks!

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 is my code:

for (int i = 0; i < n; i++)
{

for (int a = 0; a < (n - (i + 1));a++)
{
printf(" ");
}

for (int b = 0; b < (i + 2); b++)
{
printf("#");
}

printf("\n");
}

It might be messy, as I took some time to get my head around it, but so far the program has worked perfectly for me. However, when I execute Check50, I get the following errors:

:( 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 ..."

I just don't understand what it wants from me.

I'd really appreciate some help! Thanks!

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 is my code:

for (int i = 0; i < n; i++)
{

for (int a = 0; a < (n - (i + 1));a++)
{
printf(" ");
}

for (int b = 0; b < (i + 2); b++)
{
printf("#");
}

printf("\n");
}

It might be messy, as I took some time to get my head around it, but so far the program has worked perfectly for me. However, when I execute Check50, I get the following errors:

:( 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             ..."

I just don't understand what it wants from me.

I'd really appreciate some help! Thanks!

Source Link
cursue
  • 35
  • 1
  • 8

Stuck on PSet1: I have the correct output, but Check50 says it's wrong

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 is my code:

for (int i = 0; i < n; i++)
{

for (int a = 0; a < (n - (i + 1));a++)
{
printf(" ");
}

for (int b = 0; b < (i + 2); b++)
{
printf("#");
}

printf("\n");
}

It might be messy, as I took some time to get my head around it, but so far the program has worked perfectly for me. However, when I execute Check50, I get the following errors:

:( 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 ..."

I just don't understand what it wants from me.

I'd really appreciate some help! Thanks!