when I executed i have this error
:) mario.c exists
:) mario.c compiles
:) rejects a height of -1
:) handles a height of 0 correctly
:) handles a height of 1 correctly
*:( handles a height of 2 correctly \ expected output, but not " # # \n## ##\n"
:( handles a height of 23 correctly \ expected output, but not " # # ..."*
:) rejects a height of 24
:) rejects a non-numeric height of "foo"
:) rejects a non-numeric height of ""
https://sandbox.cs50.net/checks/763481501d3a4229a73e0426cc06ae1a
and this is my code
int main(void)
{
int h, s, d, r;
do
{
printf("Height: ");
h = get_int();
}
while (h < 0 || h > 23);
for (r = 1; r <= h; r++)
{
for (s = 0; s < h - r; s++)
{
printf(" ");}
for (d = 0; d < r; d++)
{
printf("#");}
for(s=0; s <2; s++)
{
printf(" ");
}
for (d = 0; d < r; d++)
{
printf("#");}
for (s = 0; s < h - r; s++)
{
printf(" ");}
printf("\n");
}
}
and when I used * instead of space it looks like this