下载后可任意编辑数据结构表达式求值 #includeusing namespace std;#define TRUE 1#define FALSE 0#define Stack_Size 20#define Stack_Float 30/*建立字符栈*/ typedef struct{ char elem[Stack_Size];//存储定义 int top;}Stack_char; void InitStack(Stack_char*S)//初始化顺序栈 { S->top=-1; }int Push(Stack_char *S,char x)//进栈 { if(S->top==Stack_Size-1) return (FALSE); S->top++; S->elem[S->top]=x; return (TRUE);}int Pop(Stack_char*S,char*x)//出栈 { if(S->top==-1) return(FALSE); else { *x=S->elem[S->top]; S->top--; return(TRUE); }}int GetTop(Stack_char*S,char*x)// 取栈顶{ if(S->top==-1) return(FALSE); else {下载后可任意编辑 *x=S->elem[S->top]; return(TRUE); }}char GetTop(Stack_char S){ char x; GetTop(&S,&x); return x;}//建立数字栈 typedef struct//建立 { float elem[Stack_Float]; int top;}Stack_float;void InitStack(Stack_float*S)//初始化 { S->top=-1;}int Push(Stack_float*S,float e) //进栈 { if(S->top==Stack_Float-1) return(FALSE); else { S->top++; S->elem[S->top]=e; return(TRUE); }}int Pop(Stack_float*S,float*x)//出栈 { if(S->top==-1) return(FALSE); else { *x=S->elem[S->top]; S->top--; return(TRUE); }}int GetTop(Stack_float*S,float*x)// 取栈顶{下载后可任意编辑 if(S->top==-1) return(FALSE); else { *x=S->elem[S->top]; return(TRUE); }}float GetTop(Stack_float S){ float x; GetTop(&S,&x); return x;} bool In(char ch)//推断字符 { if(ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='('||ch==')'||ch=='#') return (TRUE); else return(FALSE); } float GetNumber(char*ch)//转化数码 { return (*ch-48);}float Execute(float a,char op,float b){ switch(op) { case'+':return(a+b);break; case'-':return(a-b);break; case'*':return(a*b);break; case'/':return(a/b);break; default:cout<<"不能运算";break; }} char Compare(char x,char ch){ if(x=='+'||x=='-') if(ch=='+'||ch=='-'||ch==')'||ch=='#') return ('>'); else return ('<'); if(x=='*'||x=='/') if(ch=='(') return(...