#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; 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')) { if((word[i]>='a'&&word[i]<='z')||(word[i]>='A'&&word[i]<='Z')) { token[n]=word[i]; n++; token[n]='