    01: #include <iostream>
    02: #include <string>
    03: #include <queue>
    04: #include <stack>
    05:
    06: using namespace std;
    07:
    08: int main()
    09: {
    10:    cout << "FIFO order:\n";
    11:
    12:    queue<string> q;
    13:    q.push("Tom");
    14:    q.push("Dick");
    15:    q.push("Harry");
    16:
    17:    stack<string> s;
    18:    while (q.size() > 0)
    19:    {
    20:       string name = q.front();
    21:       q.pop();
    22:       cout << name << "\n";
    23:       s.push(name);
    24:    }
    25:
    26:    cout << "LIFO order:\n";
    27:
    28:    while (s.size() > 0)
    29:    {
    30:       cout << s.top() << "\n";
    31:       s.pop();
    32:    }
    33:
    34:    return 0;
    35: }