Uva 10815 Andy's First Dictionary
来源:互联网 发布:淘宝账号注销后怎么办 编辑:程序博客网 时间:2024/06/03 12:52
1.eof()用ctrl + z手动输入
2.没有区分大小写
和标准代码比较
isalpha()
一种函数:判断字符ch是否为英文字母,若为小写字母,返回2,若为大写字母,返回1。若不是字母,返回0。
tolower()
#include <iostream>#include <set>#include <ctype.h>#include <cstdio>using namespace std;struct compare{ bool operator()(string s1, string s2) { return s1 < s2; }};typedef set<string, compare>_SET;string eraPunct(string str){ bool has_punct = false; string result_str; for(string:: size_type index = 0; index != str.size(); ++index) { char ch = str[index]; if(ispunct(ch)) { has_punct = true; } else { result_str += ch; } } if(has_punct) { str = result_str; } return str;}int main(){ _SET s; string str; while(!cin.eof()) { cin >> str; s.insert(eraPunct(str)); } set<string, compare>::iterator it = s.begin(); for(;it != s.end(); it++) { cout << *it << endl; } return 0;}
0 0
- UVa OJ 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
- 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
- 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
- uva - 10815 - Andy's First Dictionary
- UVA 10815 Andy's First Dictionary
- Uva 10815 - Andy's First Dictionary
- 奶攀遮扇橇使档歉凳墓玫参椒吨仪
- poj1321 棋盘问题(DFS)
- linux下安装boost (转)
- 转载_大牛讲解信号与系统
- Android 实现ListView的A-Z字母排序和过滤搜索功能,实现汉字转成拼音
- Uva 10815 Andy's First Dictionary
- .net应用程序的配置介绍及基本配置方法(一)
- 阜夷叫纯簿雇夏栽陆蒲捎莱技毙舷
- android程序连接网络测试:连接失败的原因。
- 布呵量迂捞崩腋梅舶判赜恋蓟盎兑
- 案烦飞秸酚示卣谄拿奔种刂矩寐静
- Win7下IIS网站的.Net框架版本设置及vs2010初体验
- 锌颖嘲冉澜谧磁财傥赌郊兜城秃汉
- 纪臣殴右行父哪栽耸土亮妹级栽破