#include<iostream>
using namespace std;
class stack
{
int* data;
int size;
int top;
stack(int n) {
data = new int[n];
size = n;
top = -1;
}
int empty() {
if (top == -1) {
return 1;
}
}
int top() {
if (empty()) {
return 0;
}
else {
return data[top];
}
}
int push(int val) {
if (top + 1 == size) {
return 0;
}
else {
top += 1;
data[top] = val;
return 1;
}
}
int pop() {
if (empty()) {
return 0;
}
else {
top--;
return 1;
}
}
};
int main()
{
return 0;
}
04-13
1040
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-07
103
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)