📄 00000000.htm
字号:
if(c==psn->pszSteps[nCurPos]){ <BR> nCurPos++; <BR> if(psn->pszSteps[nCurPos]=='\0'){ <BR> *pp=psn->pszFullSteps; <BR> nState=psn->nEnd; <BR> }else <BR> *pp=NULL; <BR> return nState; <BR> }else if(psn->pszSteps[nCurPos]=='*'){ <BR> if(c==psn->pszSteps[nCurPos+1]){ <BR> nCurPos+=2; <BR> }else if(!isdigit(c)){ <BR> goto break_here; <BR> } <BR> if(psn->pszSteps[nCurPos]=='\0'){ <BR> *pp=psn->pszFullSteps; <BR> nState=psn->nEnd; <BR> }else <BR> *pp=NULL; <BR> return nState; <BR> <BR> } <BR> } <BR>break_here: <BR> nCurPos=0; <BR> nCurNode++; <BR> psn++; <BR> } <BR> nState=nCurNode=nCurPos=0; <BR> *pp=NULL; <BR> nPass++; <BR> } <BR> return nState; <BR>} <BR>void main(int argc,char ** argv) <BR>{ <BR> char c; <BR> int stat=0; <BR> int nPauseDepth=0; <BR> const char *pszSteps; <BR> ofstream out(argv[1]); <BR>// ofstream stat_out("catchmsg.dat"); <BR> cin.get(c); <BR> while(!cin.eof()){ <BR> cout.put(c); <BR> int step=StepOn(c,&pszSteps); <BR> if(//stat==MSG_PAUSE <BR> nPauseDepth <BR> &&step==MSG_RESUME <BR> && pszSteps){ <BR> stat=MSG_RESUME; <BR> nPauseDepth--; <BR> out.write(pszSteps,strlen(pszSteps)); <BR> out.flush(); <BR> }else if(stat==MSG_GET){ <BR> if(step==MSG_STOP && pszSteps){ <BR> stat=0; <BR> out.put(c); <BR> out.put('\n'); <BR> out.flush(); <BR> }else{ <BR> out.put(c); <BR> out.flush(); <BR> } <BR> }else if(step==MSG_BEGIN&& pszSteps){ <BR> out.write(pszSteps,strlen(pszSteps)); <BR> out.flush(); <BR> stat=MSG_BEGIN; <BR> }else if(step==MSG_GET&& pszSteps){ <BR> if(stat!=MSG_BEGIN) <BR> out.write(pszSteps,strlen(pszSteps)); <BR> else <BR> out.put(c); <BR> out.flush(); <BR> stat=MSG_GET; <BR> }else if(stat==MSG_BEGIN||stat==MSG_RESUME){ <BR> if(step==MSG_PAUSE <BR> && pszSteps){ <BR> stat=MSG_PAUSE; <BR> nPauseDepth++; <BR> out.put(c); <BR> out.flush(); <BR> }else if(step==MSG_STOP <BR> && pszSteps){ <BR> stat=0; <BR> out.put(c); <BR> out.put('\n'); <BR> out.flush(); <BR> } <BR> if(stat&&stat!=MSG_PAUSE){ <BR> out.put(c); <BR> out.flush(); <BR> } <BR> } <BR>// stat_out<<c<<'\t'<<stat<<'\t'<<'\t'<<step<<'\n'; <BR> cin.get(c); <BR> } <BR>} <BR> <BR>-- <BR>※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.115.16.23] <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -