Created
April 15, 2022 07:23
-
-
Save dasunsucharith/6d37a2a48a3cee8d4b86551ac36a7e3a to your computer and use it in GitHub Desktop.
My solution to CS50 2022 psets-1 mario-less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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