Created
          January 10, 2019 11:47 
        
      - 
      
- 
        Save kharioki/9006389cc83e05f06307d41f3f2fa850 to your computer and use it in GitHub Desktop. 
    mario staircase c
  
        
  
    
      This file contains hidden or 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 get_positive_int(string prompt); | |
| int main(void) | |
| { | |
| int h = get_positive_int("Height: "); | |
| for (int i = 0; i < h; i++) { | |
| for ( int j = h - i; j > 1; j--) { | |
| printf(" "); | |
| } | |
| for ( int k = 0; k < i +1; k++){ | |
| printf("#"); | |
| } | |
| printf("\n"); | |
| } | |
| } | |
| int get_positive_int(string prompt) { | |
| int n; | |
| do { | |
| n = get_int("%s", prompt); | |
| } while ( n < 1 || n > 8); | |
| return n; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment