题目描述:

#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)的更多相关文章

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

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

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

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

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

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

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

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

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

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

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

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

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

  9. 安迪的第一个字典(UVa10815)

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

随机推荐

  1. HDU 1027 Ignatius and the Princess II(求第m个全排列)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1027 Ignatius and the Princess II Time Limit: 2000/10 ...

  2. win8开发

    http://msdn.microsoft.com/library/default.aspx

  3. Matplotlib——初级

    matplotlib是一个专门用来绘图的库,在分析数据的时候,使用它可以将数据进行可视化,更直观的呈现.下面是几个通过matplot绘制的图. 通过图形的绘制,我们可以很清晰地看到数据直接的关系,并对 ...

  4. spring boot从redis取缓存发生java.lang.ClassCastException异常

    目录树 异常日志信息 错误原因 解决方法 异常日志信息 2018-09-24 15:26:03.406 ERROR 13704 --- [nio-8888-exec-8] o.a.c.c.C.[.[. ...

  5. window 下创建软链接 mklink

    软链接是一种文件共享方式. 命令:mklink /d "C:\d" "C:\e" 有哪些坑: 1.此命名必须以管理员方式在cmd运行 2.文件必须不存在..通过 ...

  6.  linux命令sed与awk是干什么用的,怎么用?

    非常强大的文本操纵工具,sed,awk,grep 这个三个命令 都是操作文本文件的unix系统有几个非常命令的特点:1. 对于内核而言,unix文件都是字节序列.io设备也是文件.2. 至于文件的含义 ...

  7. Java实现“睡排序”——线程池Executors的使用

    前提 之前在知乎上看见一个有意思的排序算法——睡排序. 睡排序最早好像是4chan上一个用户用shell脚本实现的: 算法思想简洁明了:利用进程的sleep来实现 越大的数字越迟输出. 虽然像2L说的 ...

  8. C/C++中的malloc、calloc和realloc

    1. malloc 原型:extern void *malloc(unsigned int num_bytes); 头文件:Visual C++6.0中可以用malloc.h或者stdlib.h 功能 ...

  9. day 21继承

    1.了解Python2和python3类的区别:   python2.3之前使用的是经典类, 在2.3版本之后组,使用的是新式类 MRO: method resolution order  方法的查找 ...

  10. 嵌入式GPIO接口及操作(二)

    目标:C语言实现点亮LED灯 首先是main函数,并不特殊,它是被系统调用来执行的,main函数结束后要返回调用main函数的地址处,那么裸机程序,没有操作系统做这些工作,就要自己写调用main函数的 ...