该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
enum {
s_normal,
s_string,
s_string_conv,
s_linecomment,
s_linecomment_conv,
s_comment1,
s_comment,
s_commented1,
s_eof,
};
int g_state = s_normal;
int deal(int c) {
switch(g_state) {
case s_normal:
{
if (c == '\"') g_state = s_string, putchar©;
else if (c == '/') g_state = s_comment1;
else if (c == EOF) g_state = s_eof;
else putchar©;
}
break;
case s_string:
{
putchar©;
if (c == '\"') g_state = s_normal;
else if (c == '\\') g_state = s_string_conv;
else if (c == EOF) g_state = s_eof;
}
break;
case s_string_conv:
{
putchar©;
g_state = s_string;
}
break;
case s_linecomment: