#include<stack>
#include<iostream>
using namespace std;
typedef stack<int> INT_STACK;
//INT_STACK is a type definition
void main()
{
INT_STACK s;
// Push 5 elements into the stack
for(int i=0; i<5; i++)
{
s.push(i);
}
//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<<"Elements of the stack are: ";
while(!s.empty())
{
cout<<s.top<<" "; // Returns the top element of stack
s.pop(); // Pop the top element of the stack
}
cout<<endl;
}