0
#include <cs50.h>
#include<stdio.h>

int main(void)
{
    int height, row, hash, space;

    do
    {
        printf("Height: ");
        height = get_int();
    }
    while(height < 0 || height > 23);

     for (row = 1; row <= height; row++)
    {
        for (space = 0; space < (height - row); space++)
        {
            printf(" ");
        }


        for (hash = 0; hash < row; hash++)
        {
            printf("#");
        }

        printf(" ");

        for (hash = 0; hash < row; hash++)
        {
            printf("#");
        }

        printf("\n");
    }


}
1
  • Can you please edit the question and add the check50 output? You are running the "more comfortable" version of the check50 for this pset, right?
    – Cliff B
    Jan 15 '17 at 21:50
0

Quoting the instructions:

The height of the half-pyramids pictured above happens to be 4, the width of each half-pyramid 4, with an a gap of size 2 separating them.

So if I don't miss anything else, you need to add another space between the half-pyramids (currently only one in the code you posted)

You must log in to answer this question.