参考:https://www.cnblogs.com/yjlblog/p/6947747.html

https://blog.csdn.net/hnust_taoshiqian/article/details/43448793

https://blog.csdn.net/liuke19950717/article/details/49450817

https://blog.csdn.net/fanyun_01/article/details/66967710

 #include <iostream>
#include <cstdio>
#include <set>
#include <sstream>
using namespace std;
set<string> ans;
int main()
{
string s,temp;
// freopen("总结.txt","r",stdin);
while (cin>>s)//cin遇空格结束 ~
{
int i;
for (i=;i<s.length();i++)
{
if (isalpha(s[i]))
{
s[i]=tolower(s[i]);
}
else
{
s[i]=' ';
}
}
stringstream ss(s);//ss流初始化
while (ss>>temp)//同一个cin进来的s可能有多个单词~
{
ans.insert(temp);
}
}
set<string>::iterator it;
for (it=ans.begin();it!=ans.end();it++)
{
cout<<*it<<endl;
} return ;
}

Andy's First Dictionary(uva 10815) set用法的更多相关文章

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

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

  3. Andy‘s First Dictionary UVA - 10815

      Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for h ...

  4. UVa 10815 Andy's First Dictionary

    感觉这道题要比之前几个字符串处理的题目难度要大了一些. 题目大意:给若干行字符串,提取出所有单词并去掉重复的,最后按字典顺序输出. 对于输入大致有两种思路,一种是逐个读入字符,遇到字母的话就放到wor ...

  5. 【UVA - 10815】Andy's First Dictionary (set)

    Andy's First Dictionary Description 不提英文了 直接上中文大意吧 XY学长刚刚立下了再不过CET就直播xx的flag,为了不真的开启直播模式,XY学长决定好好学习英 ...

  6. UVa10815.Andy's First Dictionary

    题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  7. UVA-10815 Andy's First Dictionary (非原创)

    10815 - Andy's First Dictionary Time limit: 3.000 seconds Problem B: Andy's First DictionaryTime lim ...

  8. Problem C: Andy's First Dictionary

    Problem C: Andy’s First DictionaryTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 18 Solved: 5[Submit] ...

  9. UVA 10815 Andy&#39;s First Dictionary(字符处理)

    Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him ...

随机推荐

  1. 配置一个高效快速的Git环境

    username and email editor difftool and mergetool alias 可以直接修改~/.gitconfig文件,也可以用命令配置一个可以实际使用的高效的Git环 ...

  2. Kubernetes JSONpath Support

    export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=test-nginx,ap ...

  3. selenium+python 连接数据库

    import MySQLdb connet=MySQLdb.connect(  host='localhost',  port='8808',  user='amdin',  password='** ...

  4. 一点一点学写Makefile(4) - 编译时指定宏参数

    我们在项目中有时为了方便会自定义一些与项目无关的功能,例如打印输出一些提示信息.将关键协议生成文件等,但是如果每次都通过修改代码的方法来实现,测试部门就会认为你改的这些代码可能会带来其他问题.对于这种 ...

  5. CRUD全栈式编程架构之服务层的设计

    服务层代码 首先我先放出2个主要类的代码再分别讲解 接口 using System; using System.Collections.Generic; using System.Linq; usin ...

  6. 面向对象编程(OOP)、面向组件编程(COP)、面向方面编程(AOP)和面向服务编程(SOP)

    http://blog.csdn.net/hjf19790118/article/details/6919265 1.什么是面向对象编程(Object-Oriented Programming)? 面 ...

  7. Django:ORM关系字段

    一,ForeignKey 外键类型在ORM中用来表示外键关联关系,一般把ForeignKey字段设置在 '一对多'中'多'的一方. ForeignKey可以和其他表做关联关系同时也可以和自身做关联关系 ...

  8. 整个简历的讲解(falling+mimic+refidet)

    1.解决方案 下边缘: a.论文的数据来自kitti,gt数据来自于激光雷达,利用kitti自带的开发包先将激光雷达的数据映射到图片的二维平面,每个x,y会生成对应的d(x,y),即depth.再对每 ...

  9. 运行出现Server Tomcat v8.5 Server at localhost failed to start.和A child container failed during start

    出现问题: 解决方法: 1.看servlet文件中的@WebServlet“()”,里面是否少了/字符,如图: 加上即可,有问题随时留言,欢迎您的咨询!

  10. OpenMP使用体验报告(概述)

    (本文原创,首次使用OpenMP,将使用体会记录下来供学习) OpenMP是啥玩意??? 多核多线程处理器的出现,让并行计算成为可能.在此之前,单核处理器并不能并行计算,这是很显然的,只有一个核心只能 ...