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 ...
随机推荐
- how to create folders in batches
you need be good at thinking when you see problem. Work experience:when you need to copy web chinese ...
- day1 python 介绍、基本语法、流程控制
请查看我的云笔记链接: http://note.youdao.com/noteshare?id=0ea7425d3e3669800cb0d73f7ec8865d&sub=D87B4BF820C ...
- libxml2库函数详解
许多事物符合80/20法则,libxml中也是20%的函数提供了80%的功能.下面的列表列出了libxml的主要函数及其用法说明. 1. 全局函数说明 头文件引用 xml2config --cfl ...
- C++ cin不支持录入空格
如果在C++中,用cin>>str;这种方法来接收字符串那么录入的str不能包含空格,否则它会按照空格将整个字符串切分成若干段.如果你要是想输入带空格的字符串那就要用到getline()这 ...
- vue-router异步加载组件
export default { routes: [ { path: '/fund', name: 'FundManagement', component: function(resolve) { r ...
- OC 方法声明使用
Person.h #import <Foundation/Foundation.h> @interface Person : NSObject { int _age; } - (void) ...
- 【洛谷2624】[HNOI2008] 明明的烦恼(Python+利用prufer序列结论求解)
点此看题面 大致题意: 给你某些点的度数,其余点度数任意,让你求有多少种符合条件的无根树. \(prufer\)序列 一道弱化版的题目:[洛谷2290][HNOI2004] 树的计数. 这同样也是一道 ...
- Uva 11419 我是SAM
题目链接:https://vjudge.net/problem/UVA-11419 题意:一个网格里面有一些目标,可以从某一行,某一列发射一发子弹,可以打穿: 求最少的子弹,和在哪里打? 分析: 听说 ...
- Very Deep Convolutional Networks for Large-scale Image Recognition(vggnet)
vggNet是从AlexNet而来,主要探索卷积神经网络的深度与性能之间的关系,通过反复堆叠3x3的卷积核(c中有1x1的卷积核,也只有c中有,c是16层)和2x2的最大池化层,vggNet构筑了16 ...
- Ubuntu连接上海大学校园网(ShuWlan-1x & Shu(For All))
1.连接Shu(For All):直接连接,打开网页后可能会自动弹出登录页面,也可能需要点击浏览器菜单栏下方的跳转按钮. 2.连接ShuWlan-1x配置注意点: 认证方式:Protected EAP ...