下面这个问题这么结束输入。
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
vector<string> coll;
copy (istream_iterator <string> (cin),
istream_iterator <string> (),
back_inserter (coll));
sort (coll.begin(), coll.end());
unique_copy (coll.begin(), coll.end(), ostream_iterator <string> (cout, "\n"));
return 0;
}