
/* -----------------------------------------------------------
   Stack: LIFO data structure

   Operation 	Description
   push()	adds an element into the stack
   pop() 	removes an element from the stack
   top() 	returns the element at the top of the stack
   size() 	returns the number of elements in the stack
   empty() 	returns true if the stack is empty
   ----------------------------------------------------------- */


#include <iostream>
#include <stack>

using namespace std;

int main() 
{

  // create a stack of strings
  stack<string> colors;

  // push elements into the stack
  colors.push("Red");
  colors.push("Orange");

  cout << "Stack size: " << colors.size() << "\n\n";
  
  cout << "Stack: ";

  // print elements of stack
  while(!colors.empty()) 
  {
    cout << colors.top() << ", ";
    colors.pop();
  }
  cout << "\n\n";
 
  return 0;
}

