#include <iostream>
#include <string>
#include <set>
#include <sstream> using namespace std; set<string> dict;
//集合set的用法:每个元素最多出现一次; 安迪的第一本字典; int main()
{
string s, buf;
while(cin >> s)
{
for(size_t i = ; i < s.length(); i++)
if(isalpha(s[i]))
s[i] = tolower(s[i]);
//如果是字母则将读入的单词全部转化为小写;
else
s[i] = ' ';
stringstream ss(s);
while(ss >> buf) //将读入的单词插入到set中去;
dict.insert(buf);
}
for(set<string>::iterator it= dict.begin(); it!=dict.end(); it++)
cout << *it << endl;
return ;
}

安迪的第一本字典 - set--sstream的更多相关文章

  1. 用MVVM模式开发中遇到的零散问题总结(2)

    原文:用MVVM模式开发中遇到的零散问题总结(2) 本节目录: 1.解决动画属性被劫持问题 2.设置页面焦点默认所在对象 3.XAML模拟键盘按键 4.DataGrid数据源绑定到复杂格式(dynam ...

  2. 【DG】Oracle_Data_Guard官方直译

    [DG]Oracle Data Guard官方直译 1 Oracle Data Guard 介绍   Oracle Data Guard概念和管理10g版本2   Oracle Data Guard ...

  3. DVWA实验之Brute Force(暴力破解)- Low

    DVWA实验之Brute Force-暴力破解- Low     这里开始DVWA的相关实验~   有关DVWA环境搭建的教程请参考: https://www.cnblogs.com/0yst3r-2 ...

  4. Oracle错误览表

    Oracle 错误总结及问题解决 ORA     本文转自:https://www.cnblogs.com/zhangwei595806165/p/4972016.html  作者@承影剑 ORA-0 ...

  5. UVa 10815 安迪的第一个字典

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

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

  8. stl的集合set——安迪的第一个字典(摘)

    set就是数学上的集合——每个元素最多只出现一次,和sort一样,自定义类型也可以构造set,但同样必须定义“小于”运算符 以下代码测试set中无重复元素 #include<iostream&g ...

  9. 安迪的第一个字典(UVa10815)

    题目具体描述见:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_prob ...

随机推荐

  1. BitCoin Trading Strategies BackTest With PyAlgoTrade

    Written by Khang Nguyen Vo, khangvo88@gmail.com, for the RobustTechHouse blog. Khang is a graduate f ...

  2. (3.15)常用知识-sql server分页

    推荐使用row_number over()方法,或2012以上使用offset PageSize = PageNumber = 方法一:(最常用的分页代码, top / not in) UserId ...

  3. J.U.C Atomic(一)CAS原理

    CAS概念 CAS:Compare And Swap,比较并交换.java.util.concurrent包完全是建立于CAS机制之上的. CAS原理 Java CAS是通过调用Unsafe的nati ...

  4. python学习笔记(二十六)经典类和新式类的区别

    首先了解一下什么是经典类,什么是新式类 class Person: #经典类 pass class Person2(object): #新式类 pass #类名首字母都大写 #在python3里面经典 ...

  5. OpenSSL拒绝服务漏洞(CNVD-2016-01479)

    更新OpenSSL版本. [root@nginx ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Wed Mar 22 ...

  6. ajax参数补充

    ajax参数补充 contentType 当我们使用form表单提交数据时,有一个enctype属性,默认情况下不写 此时我们提交数据时,会默认将数据以application/x-www-form-u ...

  7. java 定时器实现

    java工程中,不免遇到需要定时处理任务的需求,有如下两种方法: 1.使用java.util.TimerTask 2.使用Quartz 一.java.util.TimerTask Timer time ...

  8. XDU 1130 (快速幂)

    题目大意:原题链接 解题思路:sum((p+i*d)*C(n,i))=sum(p*C(n,i)+d*i*C(n,i)) ; 又因为i*C(n,i)=n*C(n-1,i-1) 所以sum((p+i*d) ...

  9. XDU 1001 又是苹果(状态压缩)

    #include<cstdio> #include<cstring> ; using namespace std; int r[maxn],c[maxn]; char pic[ ...

  10. 带宽、流量、CDN

    1.啥叫带宽? 1.1 带宽的概念: 在网络中的带宽往往是指一个固定的时间内,能通过的最大位数据,即数据传输率.带宽是一个计量单位,用来计量单位时间内传输的数据量的多少. 1.2 计量单位: 这个数据 ...