#include #include #include int main() { stack theStack; string s; // Build the stack from input. cout << "Type some stuff followed by CTRL-D." << endl; while( cin >> s ) { theStack.push( s ); } // Drain the stack, printing its elements as // they are popped. cout << endl << endl; while( theStack.size() > 0 ) { cout << theStack.top() << endl; theStack.pop(); } return( 0 ); }