#define N 10
typedef int T;
struct stack
{
T item[N];
int top;
public:
stack() //生成栈
void Cls() //清空栈
bool IsEmpty() //判空栈
bool push(T itm) //入栈
{
if(top == N - 1)
return false;
else
{
item[++top] = itm;
return true;
}
}
bool pop(T& itm) //出栈
{
if(top != -1)
{
itm = item[top--]; return true;
}
else
return false;
}
}