#include<iostream>
using namespace std;
const int SeqSize=50;
class SeqStack
{
int data[SeqSize];
int top;
public:
SeqStack(){top=1;}
~SeqStack(){}
void Push(int a[],int n);
void Pop();
};
void SeqStack::Push(int a[],int n)
{
top=-1;
if(top==SeqSize-1)
throw"上溢";
cout<<"入栈顺序为:"<<endl;
for(int i=0;i<n;i++)
{
data[++top]=a[i];
cout<<a[i]<<endl;
}
}
void SeqStack::Pop()
{
if(top==-1)
throw"下溢";
cout<<"出栈顺序为:"<<endl;
while(top!=-1)
{
int x=data[top--];
cout<<x<<endl;
}
}
void main()
{
SeqStack a;
int number[4]={0,1,2,3};
a.Push(number,4);
a.Pop();
}