Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cs50.h>
- #include <stdio.h>
- int main(void) {
- printf("height: ");
- int steps = GetInt();
- while (steps < 0 || steps > 23) {
- printf("please enter a number greater than 0 and less than 23\n");
- printf("height: ");
- steps = GetInt();
- }
- int space = steps;
- int hash = 1;
- for(int a = 1; a <= steps; a++) {
- space--;
- hash++;
- for(int b = 1; b <= space; b++) {
- printf(" ");
- }
- for(int c = 1; c <=hash; c++) {
- printf("#");
- }
- printf("\n");
- }
- printf("congrats u made it to the end!\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement