摘要:
#include <stdio.h>// 状态机int isRealNumber(char *p){ int state=1; int resualt=-1; while (*p) { switch(state) { case 1: if ('+'==*p||'-'==*p) { state=2; } else if (*p>='0'&&*p<='9') { state=4; } else if ('.'==*p) { state=3; } else { state=0; } 阅读全文