uva 10815 Andy's First Dictionary
2011-09-19 23:20
357 查看
题意:给你数个字符串,要你把字符串中的所以出现单词,不重复的按字典序输出。
#include <iostream> #include <stdio.h> #include <set> #include <string> #include <cstring> using namespace std; int main() { char word[1000]; set<string> adj; while(gets(word)) { string key=""; int len=strlen(word); for(int i=0;i<len;i++) { if(isalpha(word[i])) { key+=tolower(word[i]); } else { if(key!="") adj.insert(key); key=""; } } if(key!="") adj.insert(key); } set<string>::iterator it; for(it=adj.begin();it!=adj.end();it++) printf("%s\n",(*it).c_str()); return 0; }
相关文章推荐
- UVA 10815 Andy's First Dictionary(STL)
- Uva10815——Andy's First Dictionary
- UVA - 10815 Andy's First Dictionary
- UVA10815 Andy's First Dictionary
- Uva - 10815 - Andy's First Dictionary
- UVA10815 Andy's First Dictionary
- UVA 10815-Andy's First Dictionary(字符串模拟+排序+重复删除||STL-set)
- UVA 10815 Andy's First Dictionary 安迪的字典 stl应用 set+string做法
- UVa 10815 Andy's First Dictionary
- Uva 10815 Andy's First Dictionary (字典序)
- UVA10815 Andy's First Dictionary(STL)
- 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