Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define Nmax 1000
- using namespace std;
- struct Stiva
- {
- int st[Nmax];
- int top;
- void Init()
- {
- top = -1;
- }
- int Empty()
- {
- if(top == -1) return 1;
- return 0;
- }
- int Full()
- {
- if(top == Nmax - 1) return 1;
- return 0;
- }
- void Push(int x)
- {
- if(Full()) cout << "Stack Overflow!"
- else st[++top] = x;
- }
- void Pop()
- {
- if(!Empty()) top--;
- }
- int Top()
- {
- return st[top];
- }
- };
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement