题目具体描述见: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. Highcharts.js -纯javasctipt图表库初体验

    一.highcharts简介以及引入 highcharts作为免费提供给个人学习.个人网站和非商业用途使用的前端图表演示插件的确使用起来十分方便和轻便.在我最近完成一个需求的时候用到了它, 它的兼容性 ...

  2. 阳/阴性预测值Positive/negative Predictive Value(推荐AA)

    sklearn实战-乳腺癌细胞数据挖掘(博主亲自录制视频教程) https://study.163.com/course/introduction.htm?courseId=1005269003&am ...

  3. org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined

    请检查你在web.xml中加载spring.xml文件的时候没有加载成功,看你的路径是否正确 <context-param>  <param-name>contextConfi ...

  4. 复制自身程序到windows目录和system32目录下

    功能:复制自身到windows目录和system32目录下. 参考代码: #include <stdio.h> #include <windows.h> void CopySe ...

  5. php发送get和post请求

    1. Get方式实现 //初始化 $ch = curl_init(); //设置选项,包括URL curl_setopt($ch, CURLOPT_URL, "http://www.abc. ...

  6. dotnet core 实践——日志组件Serilog

     前几天把基于quartz.net的部分项目代码移植到了dotnet core ,但是没增加日志功能,原因是没找到合适的组件. 今天终于找到了Serilog: https://github.com/s ...

  7. 【CodeForces】908 D. New Year and Arbitrary Arrangement

    [题目]Good Bye 2017 D. New Year and Arbitrary Arrangement [题意]给定正整数k,pa,pb,初始有空字符串,每次有pa/(pa+pb)的可能在字符 ...

  8. 使用inline-block,使前面img,后面空div居中显示在一行后,导致当div中有内容时,div下移问题

    .pro_li img,.pro_sm{display: inline-block; *display:inline;*zoom:1;vertical-align: middle ;} 解决方法:使用 ...

  9. [POJ2356]Find a multiple 题解(鸽巢原理)

    [POJ2356]Find a multiple Description -The input contains N natural (i.e. positive integer) numbers ( ...

  10. Vue笔记之props验证

    使用props 在Vue中父组件向子组件中传送数据是通过props实现的,一个简单的使用props的例子: <!DOCTYPE html> <html> <head> ...