#include<iostream>
#include<string>
using namespace std;
template<typename T>
class Stack
{
public:
Stack(int s )
{
StackSize=s;
top=-1;
data= new T [StackSize];
}
~Stack(){}
void Push(T x);
int Pop();
T GetTop(){if(top!=-1)return data[top];}
bool Empty(){return top==-1? 1:0;}
protected:
int top;
T *data;
int StackSize;
};
template<typename T>
void Stack<T>::Push(T x)
{
if(top==StackSize-1)throw"上溢";
top++;
data[top]=x;
}
template<typename T>
int Stack<T>::Pop()
{
if(top==-1)throw"下溢";
T x;
x=data[top--];
//cout<<x;
return x;
}
//.......................................
class express
{
public:
char *exp,*postexp; //分别存放常规表达式和后缀表达式
int len;
public:
express(){
len=0;
exp=0;
postexp=0;
}
express(char *expr){
len=strlen(expr);
exp=new char[len+1];
postexp=new char[len+1];
strcpy(exp,expr);
}
~express(){
delete[] exp ;