// @topic W11-1-020 std::vector
// @brief C++ reference to std::vector

#include <iostream>
#include <cstdlib>

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

vector< string > do_input()
{
    string input;
    vector< string > container;
    cout << "Welcome, please enter a set of words followed by \"quit\": ";
    while ( cin >> input ) {
        if ( input == "quit" ) {
            break;
        }
        // populate a set of words
        container.push_back( input );
    }
    return container;
}//do_input

void print_strings( vector< string > const& vec_ref )
{
    cout << "You entered:\n";
    for ( int idx = 0; idx < vec_ref.size(); ++idx ) {
        // display individual words
        cout << vec_ref[ idx ] << endl; // "\n" '\n'
    }
}//print_strings

int main()
{
    vector< string > container = do_input();
    sort( container.begin(), container.end() );
    print_strings( container );

    system( "pause" );
    return 0;
}