fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int height = 5;
  6.  
  7. for ( int i = 0 ; i < height ; i ++ ) {
  8.  
  9. for(int j = 0; j < height - i; j++)
  10. printf(" ");
  11.  
  12. for(int j = i; j > 0; j--)
  13. printf("%d", j);
  14.  
  15. for ( int j = 0 ; j <= i ; j ++ )
  16. printf("%d", j);
  17.  
  18. printf("\n");
  19. }
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
     0
    101
   21012
  3210123
 432101234