#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <string>
#include <set>
#include <cstring>
using namespace std;
int main()
{
set<string> dict;
string in_s;
while(cin >> in_s)
{
for(unsigned int i = 0; i < in_s.length(); i++)
{
if(isalpha(in_s[i]))
in_s[i] = tolower(in_s[i]);
else
in_s[i] = ' ';
}
stringstream ss(in_s);
string buf;
while(ss >> buf) // ignore blank
dict.insert(buf);
}
for(set<string>::iterator it = dict.begin(); it != dict.end(); it++)
{
cout << *it << endl;
}
return 0;
}
UVa 10815: Andy's First Dictionary
最新推荐文章于 2017-12-21 06:09:21 发布