Example 5: (a). Required changes to Example 2 for discarding duplicates; (b). outputting the result.

    (a) set< string less< string > > words;
        transform ( istream_iterator< string, ptrdiff_t > ( cin ),
                    istream_iterator< string, ptrdiff_t > (),
                    inserter( words. words.end( ) ),
                   standardize );


    (a) copy( words.begin( ), words.end( ),
            ostream_iterator< string >( cout, "\n") );