#include<cstdio>
#include<stack>
using namespace std;
int top=-1;
const int maxsize=255;
int st[maxsize];
struct sqstack{
int sqst[maxsize];
int sqtop;
};
void sqclear(){
int sqtop=-1;
}
int sqsize(){
return top+1;
}
bool isempty(){
if(top==-1) return true;
else return false;
}
void sqpush(int x){
int st[++top]=x;
}
void sqpop(){
int top--;
}
int gettop(){
return st[top];
}
int main(){
stack<int> st;
while(!st.empty)
{
st.pop();
}
return 0;
}
栈的基本操作
最新推荐文章于 2024-05-06 23:47:06 发布