【例题5-3 UVA - 10815】Andy's First Dictionary
2017-10-12 12:28
459 查看
【链接】 我是链接,点我呀:)
【题意】
在这里输入题意
【题解】
用stringstream来处理中间的标点。
->直接把他变成一个空格。
然后重新输入进去。
set默认的字典序就是升序的了。
【错的次数】
在这里输入错的次数
【反思】
在这里输入反思
【代码】
#include <bits/stdc++.h> using namespace std; set<string> myset; string s; int main() { //freopen("F:\\rush.txt", "r", stdin); ios::sync_with_stdio(0), cin.tie(0); while (cin >> s) { int len = s.size(); for (int i = 0; i < len; i++) if (isalpha(s[i])) s[i] = tolower(s[i]); else s[i] = ' '; stringstream input(s); while (input >> s) myset.insert(s); } set <string>::iterator it; for (it = myset.begin(); it != myset.end(); it++) cout << (*it) << endl; return 0; }
相关文章推荐
- STL语法——集合:set 安迪的第一个字典(Andy's First Dictionary,UVa 10815)
- uva 10815 - Andy's First Dictionary(快排、字符串)
- UVa 10815 - Andy's First Dictionary
- UVa 10815 Andy's First Dictionary
- Uva - 10815 - Andy's First Dictionary
- UVA 10815 Andy's First Dictionary ---set
- 例题 5-3 安迪的第一个字典(Andy's First Dictionary) UVa 10815
- uva 10815 - Andy's First Dictionary
- UVa-10815-Andy's First Dictionary
- UVA 10815 - Andy's First Dictionary
- UVA10815 - 详解Andy's First Dictionary
- UVa 10815 - Andy's First Dictionary
- 【UVa 10815】Andy's First Dictionary
- 算法竞赛入门经典第五章例题5-3 Andy's First Dictionary UVA - 10815
- Uva 10815 - Andy's First Dictionary
- UVa 10815 - Andy's First Dictionary
- UVa-10815 - Andy's First Dictionary
- UVa 10815 Andy's First Dictionary
- UVa 10815 Andy's First Dictionary
- UVA10815 - Andy's First Dictionary