Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define DELIM " \n,.;:!?'"
- int main()
- {
- FILE *fin, *fout;
- fin = fopen("files1.txt", "r");
- fout = fopen("files1_o.txt", "w");
- char s[128], *p;
- while(fgets(s, 128, fin))
- {
- for (p=strtok(s, DELIM); p; p=strtok(NULL, DELIM))
- if (*p=='a')
- fprintf(fout, "%s ", p);
- }
- fprintf(fout, "\n");
- fclose(fin);
- fclose(fout);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement