fork(53) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. char buffer[10000];
  6. char *pbuff;
  7. int value;
  8.  
  9. while (1) {
  10. if (!fgets(buffer, sizeof buffer, stdin)) break;
  11. printf("Line contains");
  12. pbuff = buffer;
  13. while (1) {
  14. if (*pbuff == '\n') break;
  15. value = strtol(pbuff, &pbuff, 10);
  16. printf(" %d", value);
  17. }
  18. printf("\n");
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 1680KB
stdin
1 2 53 7 27 8
67 5 2
1 56 9 100 2 3 13 101 78
stdout
Line contains 1 2 53 7 27 8
Line contains 67 5 2
Line contains 1 56 9 100 2 3 13 101 78