参考: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. Laravel 生成小程序图文海报最佳方案之一

    目前已经更新 2.0 版本,支持生成的海报关联Model,支持是否重新生成海报等功能,具体更新请移步 github: laravel-miniprogram-poster 微信小程序官方并未提供分享到 ...

  2. Android下最小化程序到后台代码

    procedure TForm1.Button4Click(Sender: TObject); var    Intent: JIntent; begin    Intent := TJIntent. ...

  3. 利用Docker volume修改Nginx Docker镜像里index.html

    通过这个小例子我们可以进一步加深对Docker volume概念的理解和使用方法. 我们都知道运行基于Docker的Nginx镜像后,访问localhost能看到Nginx默认的首页,这个首页的位置是 ...

  4. IOS6 的特性 及 autoalyout的作用

    1.如果控件有默认的内容(宽高), 我们只需设置autoalyout的X/Y, autolayout会自动计算出宽高 2.Xcode6将Storyboard变成豆腐干的目的:在Xcode6之前, 如果 ...

  5. LA 3126 出租车

    题目链接:https://vjudge.net/problem/UVALive-3126 题意:有m个客人,位于不同的位置,去一些地方,出发的时间给出,要一些出租车去接,但是,每辆出租车要在出发前一分 ...

  6. 实验吧之损坏的U盘

    1.首先用binwalk查看里面的内容,发现里面有Zip文件. 要想把Zip文件弄出来有两种方法: 一是用虚拟机里面的foremost+文件名 然而,在终端中已经见到二零password文件夹,然而我 ...

  7. Ubuntu 16.04 安装 IDEA

    1.下载地址:https://www.jetbrains.com/idea/download/#section=linux 选择without jdk版本下载 2.下载完成 解压 到 /opt下 先却 ...

  8. Intellij IDEA中Maven解决依赖失效

    最近在折腾Maven和Sonatype的Nexus, 倒霉催的国内和公司网络... Nexus配合finalspeed或者kcptun倒是很给力,  但是Intellij就经常出问题, 出现红字也不动 ...

  9. 【题解】洛谷P3166 [CQOI2014] 数三角形(组合+枚举)

    洛谷P3166:https://www.luogu.org/problemnew/show/P3166 思路 用组合数求出所有的3个点组合(包含不合法的) 把横竖的3个点共线的去掉 把斜的3个点共线的 ...

  10. override render 方法

    有时候需要在ASP.net  或MVC 中在页面呈现前,把要显示的内容作一个拦截,更改内容后显示. 只要重写 protected override void Render(System.Web.UI. ...