#include <stdio.h>

void print_pyramid(int height)
{
	for(int i = 1; i <= height; ++i)
	{
		// print spaces part of current level
		for (int j = 0; j < height - i; ++j)
		{
			printf(" ");
		}
		
		// print block parts of current level
		for (int j = 0; j < i; ++j)
		{
			printf("#");
		}
		printf("\n");
	}
}

int main(void) {
	int height = 0;
	do {
        printf("Pyramid height: \n");
        scanf("%d", &height);
    } while (height < 1 || height > 23);
    
    print_pyramid(height);
    
	return 0;
}
