fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int rows = 5;
  6. scanf("%d",&rows);
  7. for (int i = rows; i > 0; i--) {
  8. for (int j = 0; j < rows-i; j++) {
  9. printf(" ");
  10. }
  11. for (int j = 0; j < i; j++) {
  12. printf("*");
  13. }
  14. printf("\n");
  15. }
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5288KB
stdin
5
stdout
*****
 ****
  ***
   **
    *