算法之路二:刘汝佳算法竞赛入门经典:STL集合 安迪的第一个字典 UVA10851
来源:互联网 发布:美国人如何学编程的 编辑:程序博客网 时间:2024/06/07 23:37
#include<iostream>#include<string>#include<set>#include<sstream>using namespace std;set<string> dict;//string 集合 int main(){ string s,buf; while(cin>>s)//输入字符串s { for(int i=0;i<s.length();i++) if(isalpha(s[i])) s[i]=tolower(s[i]); else s[i]=' ';//si是字母把字符转换成小写 stringstream ss(s);//读取s中的单字 while(ss>>buf) dict.insert(buf); } for(set<string>::iterator it =dict.begin();it!=dict.end();++it)//iterator相当于指针 cout<<*it<<endl; return 0; }
1 0
- 算法之路二:刘汝佳算法竞赛入门经典:STL集合 安迪的第一个字典 UVA10851
- 算法入门经典:安迪的第一个字典
- 《算法竞赛入门经典2ndEdition 》例题5-3 安迪的第一个字典(Andy's First Dictionary, Uva10815)
- 算法之路二:刘汝佳算法竞赛入门经典:STL不定长数组 木块问题 UVA101
- 算法之路二:刘汝佳算法竞赛入门经典:STL映射 反片语UVA156
- 算法之路二:刘汝佳算法竞赛入门经典:STL队列 团体队列UVA540
- 算法之路二:刘汝佳算法竞赛入门经典:STL排序与检索 大理石在哪 UVA10474
- 算法竞赛入门经典-找出第一个回文子串
- 算法之路二:刘汝佳算法竞赛入门经典 3.2开灯问题
- 算法之路二:刘汝佳算法竞赛入门经典 3.3蛇形填数
- 算法之路二:刘汝佳算法竞赛入门经典 3.4竖式问题
- 算法之路二:刘汝佳算法竞赛入门经典 3.5Tex中的引号 UVa272
- 算法之路二:刘汝佳算法竞赛入门经典 3.6WERTYU UVa10082
- 算法之路二:刘汝佳算法竞赛入门经典 3.7回文词 UVa401
- 算法之路二:刘汝佳算法竞赛入门经典 3.8猜数字游戏 UVa340
- 算法之路二:刘汝佳算法竞赛入门经典 3.9生成元 UVa1583
- 算法之路二:刘汝佳算法竞赛入门经典 3.10环状序列 UVa1584
- 算法之路二:刘汝佳算法竞赛入门经典 组合数和素数判定
- 【Apache ZooKeeper】理解ZooKeeper中的Watches
- python中sum函数
- hdu 2846 Repository(字典树)
- 算法训练 猴子分苹果
- CF388 D
- 算法之路二:刘汝佳算法竞赛入门经典:STL集合 安迪的第一个字典 UVA10851
- 4 tomcat7.0源码导入eclipse
- 【1月25日】并发(二):线程安全
- 相对布局
- KiCad设计PCB-32-电源部分的布线
- eclipse 开发c++时 undefined reference to `_WinMain@16'问题的解决
- 二级联动:JSON和XML实现
- urllib.urlopen已替换为urllib.request.urlopen()
- JavaScript 瀑布