Cài đặt Stack - Mang
#define maxLength 101
struct Stack{
int a[maxLength]
int top;
};
void Create(Stack &s){
s.top =0;
}
bool Empty(Stack s){
return s.top==0;
}
void Push(int x, Stack &s){
if(s.top==maxlength-1) cout<<"FULL";
else {
s.top++;
s.a[s.top] = x;
}
}
void Pop(Stack &s){
if(s.top==0)
cout<<"Empty";
else s.top --;
}
int Top(Stack s){
return s.a[s.top];
}