Created
February 3, 2016 22:14
-
-
Save i0na-k/c9a915537a71368b0e72 to your computer and use it in GitHub Desktop.
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 height = 0; | |
// getting an input from the user | |
do | |
{ | |
printf("give Mario a number:"); | |
height =GetInt(); | |
} | |
while(height < 0 || height > 23); | |
for (int i = 0; i < height; i++) // run height times | |
{ | |
//should iterate height times | |
//print the space | |
for (int s = 7; s >= i+1; s--) | |
//iterate space times | |
{ | |
printf (" "); | |
} | |
//printing the blocks | |
for (int k=0; k <= i+1; k++) //iterate | |
{ | |
printf ("#"); | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment