00001 #include <stdlib.h> 00002 #include <stdio.h> 00003 #include <string.h> 00004 00005 #define N 1000 00006 int main( void ) 00007 { 00008 static char s[N]; 00009 int indoc=0; 00010 00011 while (fgets(s,N,stdin)) { 00012 if (strstr(s,"<DOC>")) indoc=1; 00013 else if (strstr(s,"</DOC>")) { indoc=0; fprintf(stdout,"\n"); } 00014 else if (indoc) fputs(s,stdout); 00015 } 00016 00017 return 0; 00018 }