#include #include #include int main() { FILE *fin, *fout; char buf[1000]; int i; printf("Hello........\n"); if((fin=fopen("qin.txt","r")) == NULL) { printf("Error from open qin.txt!\n"); exit(1); } if((fout=fopen("qout1.txt","w")) == NULL) { printf("Error from open qout1.txt!\n"); exit(1); } i=1; while (NULL != fgets(buf, sizeof(buf), fin)) { printf("*%d: %s",i++,buf); if((strstr(buf,"H *page* S") != NULL) || (strstr(buf,"S *page* H") != NULL)) { printf(" **: %s",buf); fputs(buf,fout); } } fclose(fin); fclose(fout); printf("OK!\n"); }