#include enum eState { CODE = 0, STRING, BSLASH, SLASH1, SLASH2 }; int main(){ int status = CODE; int c = 0; do{ c = getc(stdin); switch (status){ case CODE : switch(c){ case '/' : status = SLASH1; break; case '"' : status = STRING; break; } break; case STRING : switch(c){ case '\\' : status = BSLASH; break; case '"' : status = CODE; break; } break; case BSLASH : status = STRING; break; case SLASH1 : switch(c){ case '/' : status = SLASH2; break; default: status = CODE; } break; case SLASH2 : switch(c){ case '\n' : status = CODE; } printf("%c",c); break; } }while(c != EOF); return 0; }