Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cs50.h>
- int main(void)
- {
- retry:
- printf("Enter hight(3-23): "); // please enter a number
- int hight = get_int();
- if (hight >= 3 && hight <= 23)
- {
- for (int i = 1; i <= hight; i++) //lines counter
- {
- for (int space = hight; space >= i; space--) //space counter
- {
- printf(" ");
- }
- for (int hash = 0; hash <= i; hash++) //hash counter
- {
- printf("#");
- }
- printf("\n");
- }
- }
- else
- {
- goto retry;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement