uva10815 sstream文本读入模板
来源:互联网 发布:软件汉化 编辑:程序博客网 时间:2024/05/19 01:59
#include<bits/stdc++.h>#include<stdio.h>#include<algorithm>#include<queue>#include<string.h>#include<iostream>#include<math.h>using namespace std;#define ll long longconst int maxn=1e4+7;const int inf=0x3f3f3f3f;#define FOR(n) for(int i=1;i<=n;i++)#define pb push_backnamespace fastIO{ #define BUF_SIZE 100000 #define OUT_SIZE 100000 #define ll long long //fread->read bool IOerror=0; inline char nc(){ static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE; if (p1==pend){ p1=buf; pend=buf+fread(buf,1,BUF_SIZE,stdin); if (pend==p1){IOerror=1;return -1;} //{printf("IO error!\n");system("pause");for (;;);exit(0);} } return *p1++; } inline bool blank(char ch){return ch==' '||ch=='\n'||ch=='\r'||ch=='\t';} inline void read(int &x){ bool sign=0; char ch=nc(); x=0; for (;blank(ch);ch=nc()); if (IOerror)return; if (ch=='-')sign=1,ch=nc(); for (;ch>='0'&&ch<='9';ch=nc())x=x*10+ch-'0'; if (sign)x=-x; } inline void read(ll &x){ bool sign=0; char ch=nc(); x=0; for (;blank(ch);ch=nc()); if (IOerror)return; if (ch=='-')sign=1,ch=nc(); for (;ch>='0'&&ch<='9';ch=nc())x=x*10+ch-'0'; if (sign)x=-x; } inline void read(double &x){ bool sign=0; char ch=nc(); x=0; for (;blank(ch);ch=nc()); if (IOerror)return; if (ch=='-')sign=1,ch=nc(); for (;ch>='0'&&ch<='9';ch=nc())x=x*10+ch-'0'; if (ch=='.'){ double tmp=1; ch=nc(); for (;ch>='0'&&ch<='9';ch=nc())tmp/=10.0,x+=tmp*(ch-'0'); } if (sign)x=-x; } inline void read(char *s){ char ch=nc(); for (;blank(ch);ch=nc()); if (IOerror)return; for (;!blank(ch)&&!IOerror;ch=nc())*s++=ch; *s=0; } inline void read(char &c){ for (c=nc();blank(c);c=nc()); if (IOerror){c=-1;return;} } #undef OUT_SIZE #undef BUF_SIZE }; using namespace fastIO;set<string>dict;int main(){string s,buf;while(cin>>s){for(int i=0;i<s.length();i++)if(isalpha(s[i]))s[i]=tolower(s[i]);else s[i]=' ';stringstream ss(s);while(ss>>buf)dict.insert(buf);}for(set<string>::iterator it=dict.begin();it!=dict.end();++it)cout<<*it<<endl;}
阅读全文
0 0
- uva10815 sstream文本读入模板
- uva10815
- UVA10815
- uva10815
- UVA10815
- uva10815
- uva10815
- UVA10815
- uva10815
- UVA10815
- UVa10815
- Uva10815
- 例题5-3 UVa10815 Andy's First Dictionary(STL:set&&sstream的应用)
- Java 文本读入读出
- sstream
- sstream
- sstream
- 读入优化的模板
- 学习笔记31-C/C++字符串输入
- PHP修改图片大小的实现方法
- 崔雪莉个人介绍
- JAVA 类名.class是什么意思?
- 数组环形扫描
- uva10815 sstream文本读入模板
- 动态规划——Floyd最短路径算法
- 图论总结 Dijkstra Tarjan 最小生成树 二分图 最短路 强连通分量 双连通分量 Bellman-Ford SPFA 二分图染色 Kruskal Prim 网络流 二分图匹配 Dinic
- 垃圾回收的优点和原理 并考虑2种回收机制
- windows系统文件名太长导致无法打开删除移动
- 从开源项目,入坑Kotlin
- MyBatis Generator生成DAO——序列化
- 值得膜拜的三个数据分析案例
- C语言可变参数的使用