Skip to content

Instantly share code, notes, and snippets.

@dasunsucharith
Created April 15, 2022 07:23
Show Gist options
  • Save dasunsucharith/6d37a2a48a3cee8d4b86551ac36a7e3a to your computer and use it in GitHub Desktop.
Save dasunsucharith/6d37a2a48a3cee8d4b86551ac36a7e3a to your computer and use it in GitHub Desktop.
My solution to CS50 2022 psets-1 mario-less
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int h;
do
{
h = get_int("Height: ");
}
while (h < 1 || h > 8);
for (int i = 1; i <= h; i++){
for (int k = i; k < h; k++)
{
printf(" ");
}
for (int j=1; j<=i; j++)
{
printf("#");
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment