Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- struct Stiva
- {
- int a[1001], top;
- void Init()
- {
- top = -1;
- }
- int Empty()
- {
- if(top == -1) return 1;
- return 0;
- }
- void Push(int x)
- {
- a[++top] = x;
- }
- void Pop()
- {
- if(!Empty()) top--;
- }
- int Top()
- {
- return a[top];
- }
- };
- int main()
- {
- Stiva s, s1, s2;
- s.Init();
- s1.Init();
- s2.Init();
- int n, i, x;
- ifstream fin("s1.in");
- fin >> n;
- for(i = 0; i < n; i++)
- {
- fin >> x;
- s1.Push(x);
- }
- fin.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement