转载:http://blog.csdn.net/wskz876/article/details/17025723
int main(int argc, const char *argv[])
{
set<string> set_str;
string str;
while(cin>>str)
set_str.insert(str);
set<string>::iterator iter=set_str.begin();
while(iter!=set_str.end())
{
cout<<*iter<<endl;
++iter;
}
system("pause");
return 0;
}