您的位置:首页 > 其它

算法竞赛入门经典第五章例题5-3 Andy's First Dictionary UVA - 10815

2018-01-07 13:17 417 查看
https://vjudge.net/problem/UVA-10815

#include<iostream>
#include<sstream>
#include<set>
#include<string>
using namespace std;
#pragma warning(disable:4996)
const int maxn = 30;

int main()
{
#ifdef _DEBUG
//freopen("in", "rb", stdin);
//freopen("out", "wb", stdout);
#endif // _DEBUG
set<string> all;
string s;
while (cin >> s) {
for (auto &x : s) {
if (isalpha(x)) x = tolower(x);
else x = ' ';
}
stringstream ss(s);
while (ss >> s) all.insert(s);
}
for (auto x : all)
cout << x << endl;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: