#include #include static int atbol; static int atcr; static char first[5]; int main(void); int main(void) { int c; int i; for (i=0;i<5;i++) { c = getchar(); if (c == EOF) { if (i > 0) fwrite(&first[0],1,i,stdout); exit(0); } first[i] = c; } if ( (first[0] == 'H') && (first[1] == 'T') && (first[2] == 'T') && (first[3] == 'P') && (first[4] == '/') ) { atbol = 0; atcr = 0; while (1) { c = getchar(); if (c == EOF) exit(0); if (c == '\r') { atcr = 1; continue; } if ((c == '\n') && atbol) break; atcr = 0; atbol = (c == '\n'); } } else { fwrite(&first[0],1,5,stdout); } while (1) { c = getchar(); if (c == EOF) exit(0); putchar(c); } }