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