fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int loop = 9;
  6. int i;
  7. int j;
  8. int sloop;
  9.  
  10. for(i = 1; i <= loop; i++){
  11.  
  12. sloop = loop-i;
  13.  
  14. for(j = 1; j <= sloop; j++ ){
  15. printf(" ");
  16. }
  17.  
  18. for(j = 1; j <= loop-sloop; j++){
  19. printf("%d", j);
  20. }
  21.  
  22. for(j = loop-sloop-1; j >= 1; j--){
  23. printf("%d", j);
  24. }
  25.  
  26. printf("\n");
  27. }
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
        1
       121
      12321
     1234321
    123454321
   12345654321
  1234567654321
 123456787654321
12345678987654321