zoukankan      html  css  js  c++  java
  • uva10815 sstream文本读入模板

    #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 long
    const int maxn=1e4+7;
    const int inf=0x3f3f3f3f;
    #define FOR(n) for(int i=1;i<=n;i++)
    #define pb push_back
    
    namespace 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!
    ");system("pause");for (;;);exit(0);}  
    	}  
    	return *p1++;  
    }  
    inline bool blank(char ch){return ch==' '||ch=='
    '||ch=='
    '||ch=='	';}  
    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;
    }

  • 相关阅读:
    HDFS文件操作(基本文件命令)
    <a> 标签
    css text-overflow
    zepto.js 打包自定义模块
    CSS3 box-sizing
    CSS3 Filter
    JQ 导出 Excel
    outline css2
    iphone 操作手势种类
    动手写一个简单的Web框架(模板渲染)
  • 原文地址:https://www.cnblogs.com/Drenight/p/8611261.html
Copyright © 2011-2022 走看看