https://cn.vjudge.net/contest/177260#problem/C

stringstream :https://blog.csdn.net/xw20084898/article/details/21939811

学习:http://www.cnblogs.com/yjlblog/p/6947747.html

注意set的*

 #include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<stdlib.h>
#include<algorithm>
#include<queue>
#include<vector>
#include<string>
#include<set>
#include<cctype>
#include<sstream>
#define mem(a) memset(a,0,sizeof(a))
#define LL long long
using namespace std;
const long long N=1e9+;
set<string>ans;
int main()
{
//用set,元素只能出现一次,并且插入可以从小到大排序
string s,tmp;
while(cin>>s)
{
for(size_t i=;i<s.size();i++) //size_t一般用来表示一种计数
if(isalpha(s[i])) //小写字母返回2,大写字母返回1
s[i]=tolower(s[i]); //变小写
else s[i]=' ';
stringstream ss(s);
while(ss>>tmp) ans.insert(tmp); //向tmp中写入值,传值<<,
}
for(set<string>::iterator it=ans.begin();it!=ans.end();it++)
{
cout<<*it<<endl;
/*set不是数组 只能通过迭代器(iterator)把里面的元素倒出来
迭代器相当于是指针 扫描的是地址 因此输出的时候需要用*variation*/
}
return ;
}
//输出时在空行输入 ctrl+z+回车

最新文章

  1. C#基于Socket的简单聊天室实践
  2. CSS3选择器的研究,案例
  3. ffmpeg解码视频流
  4. [转]IntelliJ Idea 常用快捷键 列表(实战终极总结!!!!)
  5. Google Chrome开发者工具
  6. Angualar:指令大全
  7. 【算法】简单动态规划——三逆数的O(N^2)解法!
  8. c语言编程之双向循环链表
  9. bing 输入法,切换简体、繁体快捷键与myeclipse 格式化代码冲突。。
  10. android开发之SnackBar的使用
  11. silverlight 打印
  12. DBSCAN(Density-based spatial clustering of applications with noise)
  13. 开始DDD
  14. spring @Component
  15. OpenGL ES2.0光照
  16. 二级导航 js
  17. ps快捷键(有道云笔记翻出来以前的存货)
  18. HQL数据查询基础
  19. java 中的闭包
  20. [Swift实际操作]七、常见概念-(5)使用NSString对字符串进行各种操作

热门文章

  1. Linux系统初始化配置项(centos7)
  2. React Native——react-navigation的使用
  3. Zookeeper分布式集群原理与功能
  4. LOJ#2723 多边形
  5. jdbc增删改查进行封装
  6. Gaussian Process for Regression
  7. LFYZ-OJ ID: 1026 数的计数(数的计算)NOIP2001
  8. ArcGis 属性表.dbf文件使用Excel打开中文乱码的解决方法
  9. java(9)类和对象
  10. safari中input、textarea无法输入的问题