下载后可任意编辑数据结构表达式求值 #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(Sta