//
//  main.cpp
//  Stack
//
//  Created by Himanshu on 03/10/21.
//

#include <iostream>
#include <stack>
using namespace std;

int main () {
    
    stack<int> st;
    
    cout<<"Push(x) {10, 20, 30, 40, 50}"<<endl;
    st.push(10);
    st.push(20);
    st.push(30);
    st.push(40);
    st.push(50);

    cout<<"Stack-Empty(): ";
    if (st.empty()) {
        cout<<"Stack is empty"<<endl;
    } else {
        cout<<"Stack is not empty"<<endl;
    }
    
    cout<<"Pop elements..."<<endl;
    while (!st.empty()) {
        cout<< st.top()<<" ";
        st.pop();
    }
    cout<<endl;
    
    cout<<"Stack-Empty(): ";
    if (st.empty()) {
        cout<<"Stack is empty"<<endl;
    } else {
        cout<<"Stack is not empty"<<endl;
    }
    
  return 0;
}