#include<iostream>
using namespace std;
#define MAXSIZE 100
class SqStack
{
public:
int data[MAXSIZE];
int top;
SqStack()
{
top = -1;
}
};
bool push(SqStack& s, int x)//栈的头插
{
if (s.top == MAXSIZE - 1)//栈满报错
return false;
s.top++;
s.data[s.top] = x;
return true;
}
bool Pop(SqStack& s, int x)//出栈元素
{
if (s.top == -1)
return false;
x = s.data[s.top];
s.top = s.top - 1;
return true;
}
bool Gettop(SqStack& s,int x)//读取栈顶元素
{
if (s.top == -1)
return false;
x = s.data[s.top];
return true;
}
bool Erase(SqStack& s, int j)//删除下表元素
{
for (int i = j; i <= s.top-1; i++)
{
s.data[i] = s.data[i + 1];
}
return false;
}
int main()
{
return 0;
}
09-03
205
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-27
1391
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-03
202
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-29
1742
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31
248
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-03
479
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-03
364
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-26