Created
February 3, 2016 11:41
-
-
Save i0na-k/6f2cca5a0af90d81ff09 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 = i- 1; 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