/*定义from baidubaike
后缀表达式,又称逆波兰式,指的是不包含括号,运算符放在两个运算对象的后面,所有的计算按运算符出现的顺序,严格从左向右进行(不再考虑运算符的优先规则)
"$"作为结束符
*/
#ifndef PCH_H
#define PCH_H
#include<stdio.h>
#include<iostream>
#include<cstdlib>
#include<malloc.h>
#include<math.h>
#include<string>
constexpr auto OK = 1;
constexpr auto ERROR = 0;
constexpr auto MAXSIZE = 100;
typedef int Status;
// TODO: 添加要在此处预编译的标头
typedef struct
{
int *top;
int *base;
int stacksize;//栈最大可用容量
}SqStack;
Status InitStack(SqStack &S);
Status Push(SqStack &S,int e);
Status Pop(SqStack &S, int &e);
Status GetTop(SqStack S);
Status EmptyStack(SqStack S);
Status DestroyStack(SqStack &S);
void PostfixExpression();
#endif //PCH_H
----------
后缀表达式(逆波兰式)
最新推荐文章于 2020-12-03 07:45:44 发布