题目具体描述见:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1756

C++11代码如下:

 #include<iostream>
#include<set>
#include<string>
#include<sstream>
using namespace std;
set<string> dict; int main() {
string s,buf;
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) dict.insert(buf);
}
for (set<string>::iterator it = dict.begin(); it != dict.end(); it++)
cout << *it << endl;
return ;
}

安迪的第一个字典(UVa10815)的更多相关文章

  1. 5_3 安迪的第一个字典(UVa10815)<set的使用>

    Andy 是个 8 岁的孩子,他梦想要制作一本他自己的字典. 这并不是一件容易的事,因为他认识的字还不是那么多. 他并不想要自己去想这本字典中该放哪些字,他有个聪明的主意. 就是拿出他最喜欢的一本故事 ...

  2. 安迪的第一个字典 (Andy's First Dictionary,UVa10815)

    题目描述: #include<iostream> #include<string> #include<set> #include<sstream> us ...

  3. UVa 10815 安迪的第一个字典

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  4. stl的集合set——安迪的第一个字典(摘)

    set就是数学上的集合——每个元素最多只出现一次,和sort一样,自定义类型也可以构造set,但同样必须定义“小于”运算符 以下代码测试set中无重复元素 #include<iostream&g ...

  5. 安迪的第一个字典(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 ...

  6. 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 ...

  7. 安迪的第一个字典(Andy's First Dictionary,Uva 10815)

    输入一个文本,找出所有不同的单词(连续的字母序列),按字典序从小到大输出.单 词不区分大小写. 样例输入: Adventures in Disneyland Two blondes were goin ...

  8. [STL] UVA 10815 安迪的第一个字典 Andy's First Dictionary

    1.set 集合 哦....对了,set有自动按照字典序排序功能..... 声明和插入操作 #include <cstdio> #include <vector> #inclu ...

  9. 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 ...

随机推荐

  1. centos上部署git

    安装Git #安装依赖环境 [root@wys01 wys]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib- ...

  2. 使用 css 的 keyframe 实现 loading 动画

    效果查看:https://jsfiddle.net/rubys/je16qL5k/6/ <!DOCTYPE html> <html lang="en"> & ...

  3. vmvare-centos7-vim

    centos7网络连不上问题 http://geekflare.com/no-internet-connection-from-vmware-with-centos-7/ http://www.jia ...

  4. update condition 字段报错

    mysql> update tf_user_present set condition="0" where id=1;ERROR 1064 (42000): You have ...

  5. width: calc(100% - 20px);

    width: calc(100% - 20px); css3 的 calc()函数.这里的意思是设置宽度比100%的宽度少20px. calc()函数用于动态计算长度值. calc()函数支持 &qu ...

  6. C#获取Json字符串中的某个值

    问题描述: json数据格式{"resCode":0,"resMag":"aaa","data":[{"par ...

  7. [USACO14MAR] Counting Friends

    题目描述 Farmer John's N cows (2 <= N <= 500) have joined the social network "MooBook". ...

  8. IIC总线学习

    IIC总线 IIC协议简要说明: 1.2条双向串行线,一条数据线称为SDA,一条时钟线SCL,双向半双工 2.传输的设备之间只是简单的主从关系,主机可以作为主机发送也可以作为主机接收,任何时候只能由一 ...

  9. Javascript的执行过程详细研究

    下面我们以更形象的示例来说明JavaScript代码在页面中的执行顺序.如果说,JavaScript引擎的工作机制比较深奥是因为它属于底层行为,那么JavaScript代码执行顺序就比较形象了,因为我 ...

  10. HDU 1711 Number Sequence (字符串处理 KMP)

    题目链接 Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...