以前编的后缀表达式求值,看对你有用没
#include
#include
using namespace std;
const double PI=3.141592654;
const int SZ=1000;
int MKAC=0;
double STP=1;
template
class STACK{
private:
Type base[SZ];
int Size;
public:
STACK(){Size=0;};
void push(Type a) //入栈
{
base[Size]=a;
Size++;
}
Type pop() //出栈
{
return base[--Size];
}
int size()
{return Size;}
};
bool IsData(char ch)
{
return ((ch>='0'&&ch