Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- int i;
- char str[20], rev[20];
- FILE *fpr, *fpw;
- fpr = fopen("F:\\input.txt", "r");
- fpw = fopen("F:\\output.txt", "w");
- while(fscanf(fpr, "%s", str) != EOF)
- {
- strcpy(rev, str);
- strrev(rev);
- if(strcmp(str, rev) != 0)
- {
- fprintf(fpw, "NO ");
- }
- else
- {
- fprintf(fpw, "%s ", str);
- }
- }
- fclose(fpr);
- fclose(fpw);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement