#include<stack>
#include<iostream>
#include<string>
using namespace std;
typedef stack<int> STRING_STACK;
//STRING_STACK is a type definition
string p;
void main()
{
SRING_STACK s;
// Push 5 elements into the stack
for(int i=0; i<5; i++)
{
cout<<"Pushing element" <<i<< "into the stack"<<endl;
cin>>p;
s.push(p);
}
// Demonstrate the size function of the stack class
cout<<endl;<<"Size of the stack is : "<<s.size()<<endl<<endl;
// Demonstrate the top() and pop() functions
cout<<"The pushed Elements are :";
while(!s.empty())
{
cout<<s.top()<<" " ; // Returns the top element of stack
s.pop(); // Pops the top element of the stack
}
cout<<endl;
}