Andy's First Dictionary(uva 10815) set用法
参考: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用法的更多相关文章
- 安迪的第一个字典(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 ...
- 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 ...
- 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 ...
- UVa 10815 Andy's First Dictionary
感觉这道题要比之前几个字符串处理的题目难度要大了一些. 题目大意:给若干行字符串,提取出所有单词并去掉重复的,最后按字典顺序输出. 对于输入大致有两种思路,一种是逐个读入字符,遇到字母的话就放到wor ...
- 【UVA - 10815】Andy's First Dictionary (set)
Andy's First Dictionary Description 不提英文了 直接上中文大意吧 XY学长刚刚立下了再不过CET就直播xx的flag,为了不真的开启直播模式,XY学长决定好好学习英 ...
- UVa10815.Andy's First Dictionary
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- UVA-10815 Andy's First Dictionary (非原创)
10815 - Andy's First Dictionary Time limit: 3.000 seconds Problem B: Andy's First DictionaryTime lim ...
- Problem C: Andy's First Dictionary
Problem C: Andy’s First DictionaryTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 18 Solved: 5[Submit] ...
- UVA 10815 Andy's First Dictionary(字符处理)
Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him ...
随机推荐
- 【Leetcode】【Easy】Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For examp ...
- centos开启IPV6配置方法
目前国内大部分服务器和PC不支持IPV6地址的,但是服务器上本身是可以正常开启IPV6服务,有部分程序在服务器上运行的时候,需要服务器能监听一个ipv6地址才行,因此本文档指导如何在centos服务器 ...
- NODE-windows 下安装nodejs及其配置环境
相信对于很多关注javascript发展的同学来说,nodejs已经不是一个陌生的词眼.有关nodejs的相关资料网上已经铺天盖地.由于它的高并发特性,造就了其特殊的应用地位. 国内目前关注最高,维护 ...
- Excel-怎样实现行列转置
有时候,我们为了某些需要,必须把工作表的行列进行转置的方式显示.重新输入很浪费时间,怎样简单的实现转置呢,强大的excel2007提供了此项功能,具体怎么做,下面看我来演示一下. 工具/原料 装有 ...
- Scrum第一次冲刺
1.项目描述 为了长大学子的便捷,避免遭遇官网爆炸而无法查询成绩,课表等相关个人信息.我们决定开发长大Tips(分担官网的压力). 2.基本业务 用户可以通过学号加密码登入长大Tips 用户可以在在用 ...
- OC 成员变量 ( -> 使用 )
@interface Student : NSObject { // @public // @protected // @private // 默认的作用域是@protected int age; @ ...
- note03-计算机网络
3. 网络层 网络层的主要协议有IP.ICMP.IGMP.ARP等: IP地址分类:ABCDE ,根据32比特位的IP中网络号所占位数进行决定IP的类型 A:0 0000000 网络号| 000000 ...
- 课堂笔记——循环语句-for
一.循环:多次执行某段代码. 二.循环四要素: 1.初始条件 2.循环条件 3.状态改变 4.循环体 三.for循环 1.语法: for(初始条件;循环条件;状态改变) { 循环体 } 2 ...
- Hinge Loss
http://blog.csdn.net/luo123n/article/details/48878759 https://en.wikipedia.org/wiki/Hinge_loss ...
- Cesium.js隐藏logo等信息
css: .cesium-widget-credits{ display:none!important;}js: var viewer = new Cesium.Viewer('cs', { anim ...