fork(5) download
  1. #include <stdio.h>
  2.  
  3. void printreverse(FILE *f) {
  4. int n;
  5. if (fscanf(f, "%d", &n) != 1) return;
  6. printreverse(f); // recursive call
  7. printf("%d", n);
  8. }
  9.  
  10. int main(void) {
  11. printreverse(stdin);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 9424KB
stdin
1 2 3 4 5 6 7 -1000 8 9 10 42
stdout
421098-10007654321