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