题目具体描述见: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. oracle中 trunc(),round(),ceil(),floor的使用

    oracle中 trunc(),round(),ceil(),floor的使用 原文: http://www.2cto.com/database/201310/248336.html 1.round函 ...

  2. WinForm二三事(三)Control.Invoke&Control.BeginInvoke

    http://www.cnblogs.com/yuyijq/archive/2010/01/11/1643802.html 这个系列从2009年写到2010年,差点又成太监文.随着WPF/Silver ...

  3. Idea安装findbugs插件,以及findbugs安装find security bugs插件

    第一:先讲述Idea怎么安装findbugs插件 具体操作如下面的图所示: 然后就可以安装findbugs 第二:findbugs怎么安装find security bugs这个find bugs的插 ...

  4. [ldap]ldap server安装以及图形化操作

    https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-a-basic-ldap-server-on ...

  5. mac下c++代码阅读工具

    http://note.youdao.com/noteshare?id=101a265bb9d780444b6a03ca526b887a

  6. STL源码分析-hashtable

    http://note.youdao.com/noteshare?id=5c8d2b09c0f72af9a12b0ed2023a338d

  7. uniqid()

    uniqid() 函数基于以微秒计的当前时间,生成一个唯一的 ID.

  8. 题解 UVA1184 【Air Raid】

    有向无环图(DAG)的最小路径覆盖的模板题. 定义:在一个有向图中,找出最少的路径,使得这些路径经过了所有的点. 由题意可得这是一个有向图,而路径不能相交,于是我们知道这是无向图的不相交最小路径覆盖问 ...

  9. Creating a Cron Job in K8S

    Creating a Cron Job Cron jobs require a config file. This example cron job config .spec file prints ...

  10. centos中设置swap交换空间的大小设置和swappiness的比例设置

    首先使用free -m命令查看内存使用情况和swap的大小 关闭swap: 设置swap的大小: bs指的是Block Size,就是每一块的大小.这里的例子是1M,意思就是count的数字,是以1M ...