stack<string> s; s.push("Tom"); s.push("Dick"); s.push("Harry"); while (s.size() > 0) { cout << s.top() << "\n"; s.pop(); }