Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- #include"stacktype.h"
- #include"stacktype.cpp"
- using namespace std;
- int main()
- {
- // int arr[5];
- // StackType<int> StC;
- // if(StC.IsEmpty()){
- // cout<<"stack is empty"<<endl;
- // }
- //
- // StC.Push(5);
- // StC.Push(7);
- // StC.Push(4);
- // StC.Push(2);
- // if(StC.IsEmpty()){
- // cout<<"stack is empty"<<endl;
- // }else cout<<"stack is not empty"<<endl;
- //
- //
- //if(StC.IsFull()){
- // cout<<"stack is full"<<endl;
- // }else cout<<"stack is not full"<<endl;
- //
- // for( int j=0; j<4; j++)
- // {
- // arr[j]=StC.Top();
- // StC.Pop();
- //
- //
- // }
- //
- // for( int j=3; j>=0; j--)
- // {
- // cout<<arr[j];
- //
- //
- //
- // }
- // cout<<endl;
- //for( int j=3; j>=0; j--)
- // {
- // StC.Push(arr[j]);
- //
- //
- //
- // }
- // StC.Push(3);
- // for( int j=0; j<=4; j++)
- // {
- // arr[j]=StC.Top();
- // StC.Pop();
- //
- //
- // }
- //
- // for( int j=4; j>=0; j--)
- // {
- // cout<<arr[j];
- //
- //
- //
- // }
- //for( int j=0; j<=4; j++)
- // {
- // StC.Push(arr[j]);
- //
- //
- //
- // }
- // cout<<endl;
- // if(StC.IsFull()){
- // cout<<"stack is full"<<endl;
- // }else cout<<"stack is not full"<<endl;
- // StC.Pop();
- // StC.Pop();
- // cout<<StC.Top()<<endl;
- StackType<char> StC1;
- int n=14;
- char a;
- freopen("in.txt","r",stdin);
- //cin >> n;
- while(n--)
- {
- cin >> a;
- if(a=='(')
- StC1.Push(a);
- else if(a==')')
- StC1.Pop();
- }
- // cout << StC1.IsEmpty() ;
- //cout <<endl;
- //if(StC1.IsFull()&&StC1.IsEmpty()){
- // cout<<"stack is not balaced"<<endl;
- // }else cout<<"stack is not full"<<endl;
- //
- if(StC1.IsEmpty()){
- cout<<"stack is empty"<<endl;
- }else cout<<"stack is not empty"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement