安迪的第一个字典 (Andy's First Dictionary,UVa10815)
题目描述:
- #include<iostream>
- #include<string>
- #include<set>
- #include<sstream>
- using namespace std;
- set<string> dic;
- string s, buf;
- int main() {
- while(cin >> s) {
- for(int i = ; i < s.length(); i++)
- if(isalpha(s[i])) s[i] = tolower(s[i]); else s[i] = ' ';
- stringstream ss(s);
- while(ss >> buf) dic.insert(buf);
- }
- for(set<string>::iterator it = dic.begin(); it != dic.end(); ++it)
- cout << *it << "\n";
- return ;
- }
安迪的第一个字典 (Andy's First Dictionary,UVa10815)的更多相关文章
- [STL] UVA 10815 安迪的第一个字典 Andy's First Dictionary
1.set 集合 哦....对了,set有自动按照字典序排序功能..... 声明和插入操作 #include <cstdio> #include <vector> #inclu ...
- 安迪的第一个字典(Andy's First Dictionary,UVa 10815)
Description Andy, , has a dream - he wants to produce his very own dictionary. This is not an easy t ...
- STL语法——集合:set 安迪的第一个字典(Andy's First Dictionary,UVa 10815)
Description Andy, , has a dream - he wants to produce his very own dictionary. This is not an easy t ...
- 安迪的第一个字典(Andy's First Dictionary,Uva 10815)
输入一个文本,找出所有不同的单词(连续的字母序列),按字典序从小到大输出.单 词不区分大小写. 样例输入: Adventures in Disneyland Two blondes were goin ...
- set的运用 例题5-3 安迪的第一个字典(Andy's First Dictionary,Uva 10815)
#include<bits/stdc++.h>using namespace std;set<string> dict;int main(){ string s, buf; w ...
- 5_3 安迪的第一个字典(UVa10815)<set的使用>
Andy 是个 8 岁的孩子,他梦想要制作一本他自己的字典. 这并不是一件容易的事,因为他认识的字还不是那么多. 他并不想要自己去想这本字典中该放哪些字,他有个聪明的主意. 就是拿出他最喜欢的一本故事 ...
- UVa 10815 安迪的第一个字典
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- stl的集合set——安迪的第一个字典(摘)
set就是数学上的集合——每个元素最多只出现一次,和sort一样,自定义类型也可以构造set,但同样必须定义“小于”运算符 以下代码测试set中无重复元素 #include<iostream&g ...
- 安迪的第一个字典(UVa10815)
题目具体描述见:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_prob ...
随机推荐
- Objective-C——消息、Category和Protocol
转自:http://www.cnblogs.com/chijianqiang/archive/2012/06/22/objc-category-protocol.html 面向对象永远是个可以吐槽的话 ...
- SignalR 教程二 服务端广播
转帖官方教程:Tutorial: Server Broadcast with SignalR 2 http://www.asp.net/signalr/overview/getting-started ...
- Google Fonts导致网页加载速度慢
最近在做商城项目时候发现在加载一个html页面反应非常慢,查看发现是Google Font导致的网页加载速度缓慢,删除掉该样式会发现很多内容出错. 上网百度发现问题在于: 谷歌香港(google.co ...
- JAVA中时间格式转换
1.将任意日期格式的字符串转换为指定格式的字符串 //默认格式 String s1 = "20190110133236"; //给定格式 String s2 = "201 ...
- AppleDoc
使用AppleDoc快速生成iOS开发文档 _ 皮卡丘♪-(´ε` ) 用 appledoc 生成文档 _ Garan no dou xcode-select_ error_ tool 'xcodeb ...
- 阿里云服务器发送邮件失败,25端口被禁用,采用ssl 方式 465端口发送
/** * 邮件工具类 * User: NZG * Date: 2019/3/8 * Time: 12:25 **/ @Data @Component @Configuration @Configur ...
- 竞赛题解 - NOIP2018 保卫王国
\(\mathcal{NOIP2018}\) 保卫王国 - 竞赛题解 按某一个炒鸡dalao名曰 taotao 的话说: \(\ \ \ \ \ \ \ \ \ "一道sb倍增题" ...
- 04JavaScript语法
1.JavaScript 语法 JavaScript 是一个脚本语言. 它是一个轻量级,但功能强大的编程语言 2.JavaScript 字面量 在编程语言中,一般固定值称为字面量,如 3.14. 数字 ...
- vue 图片压缩 基于cli3 配置
chainWebpack: config => { const imagesRule = config.module.rule('images') imagesRule .use('image- ...
- Spring : Spring Security
==========================================================================spring-security-过滤器: 顶级Fil ...