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