fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char line[1024], *beg, *end;
  5. long readvalue;
  6. while (fgets(line, sizeof(line), stdin))
  7. {
  8. beg = line;
  9. for (beg = line; ; beg = end)
  10. {
  11. readvalue = strtol(beg, &end, 10);
  12. if (beg == end)
  13. break;
  14. printf("[%d]",readvalue);
  15. }
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 1724KB
stdin
1 3 5 7 8 10 11 -1
stdout
[1][3][5][7][8][10][11][-1]