#include<stdio.h> #include<string.h> #define max 100 int n=0,i=0; char token[max]; char a; char word[max]; void fuhao(); void shuzi(); main() { char *rwtab[6]={"begin","if","then","while","do","end"}; int p=0,j=0,k=0,m=0,q=1; int key=0; printf("请输入源程序(以#键结束):"); do{ scanf("%c",&a); word[p]=a; p++; }while(a!='#'); //关键字的判断 while(word[i]!='#') { while((word[i]>='a'&&word[i]<='z')||(word[i]>='A'&&word[i]<='Z')||(word[i]>='0'&&word[i]<='9')) { if((word[i]>='a'&&word[i]<='z')||(word[i]>='A'&&word[i]<='Z')||(word[i]>='0'&&word[i]<='9')) { token[n]=word[i]; n++; token[n]='