fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4. for(int i = 1, n = 1, d = 1; n <= 8; i += d){
  5. if(i == n){
  6. d = -d;
  7. } else if(i == 0){
  8. d = -d;
  9. ++n;
  10. puts("");
  11. continue;
  12. }
  13. printf("%d", i);
  14. }
  15. }
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321