/**************************************************************************************************/
/*                                                                                                */
/*  Name:  DarC KonQuesT                                                                          */
/*  Program:  #1                                                                                  */
/*  Date:  2005.9.2                                                                               */
/*  Purpose:                                                                                      */
/*  This program accepts a string of characters as input, places the characters in a stack,       */
/*  then reverses the order of the characters and displays the original and reversed back         */  
/*  to the user.                                                                                  */
/*                                                                                                */
/**************************************************************************************************/

#include <iostream>
#include <stack>
#include <string>

using namespace std;

/*  function prototypes here (if functions used)                                              */

int main() {
  stack<char> sc;
  string s,t;

  cout << "Enter a string of characters:  ";
  cin >>s;

  for(int i = 0; i<s.length(); i++) {
    sc.push(s[i]);
  }

  t = "";
  while(!sc.empty()) {
   t += sc.top();
   sc.pop(); 
  }

  cout << s << " reversed is " << t << endl;

  return 0;
}

