fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #define MAX_BUF_SIZE 255
  5.  
  6. void ExtractData(FILE *fp)
  7. {
  8. for (char buf[MAX_BUF_SIZE]; fgets(buf, (int)sizeof(buf), fp) != NULL;)
  9. {
  10. char *cp;
  11.  
  12. for (cp = buf; isspace(*cp); cp++)
  13. ;
  14. for (; (cp = strtok(cp, "ABC")); cp = NULL)
  15. puts(cp);
  16. }
  17. }
  18.  
  19. int main() {
  20. ExtractData(stdin);
  21. return 0;
  22. }
Success #stdin #stdout 0s 9432KB
stdin
      123A456
    789A777B333
stdout
123
456

789
777
333