fork(1) download
  1. #include <stdio.h>
  2. #include <limits.h>
  3.  
  4. int main(void) {
  5. int num = INT_MAX;
  6. char text[11];
  7. sprintf(text, "%d", abs(num));
  8.  
  9. for(int w=0; w<strlen(text); ++w)
  10. for(int s=0; s<strlen(text)-w; ++s)
  11. printf("%.*s\n", w+1, text+s);
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5424KB
stdin
Standard input is empty
stdout
2
1
4
7
4
8
3
6
4
7
21
14
47
74
48
83
36
64
47
214
147
474
748
483
836
364
647
2147
1474
4748
7483
4836
8364
3647
21474
14748
47483
74836
48364
83647
214748
147483
474836
748364
483647
2147483
1474836
4748364
7483647
21474836
14748364
47483647
214748364
147483647
2147483647