锰锌求助
  • 板块灌水区
  • 楼主WarningQAQ
  • 当前回复2
  • 已保存回复2
  • 发布时间2020/12/4 08:11
  • 上次更新2023/11/5 06:45:42
查看原帖
锰锌求助
269295
WarningQAQ楼主2020/12/4 08:11
#include"cstdio"
#include"cctype"
#include"typeinfo"
char buffer[1<<28],*S=buffer,puffer[1<<28],*T=puffer;
struct reader{
	typedef long long ll;
	typedef unsigned long long ull;
	typedef unsigned u;
	template<typename ST>
	reader operator>>(ST&x){
		if(typeid(x)==typeid(int)||typeid(x)==typeid(ll)||typeid(x)==typeid(u)||typeid(x)==typeid(ull)){
			int f=0;x=0;
			while(!isdigit(*S))f|=(*S++=='-');
			while(isdigit(*S))x=(x<<3)+(x<<1)+(*S++^48);
			x=f?-x:x;
		}
		else if(typeid(x)==typeid(char)){
			while(isspace(*S))S++;
			x=*S++;
		}
		else if(typeid(x)==typeid(char*)){
			while(isspace(*S))S++;
			while(!isspace(*S))x=*S++,x++;
		}
		return*this;
	}
	template<typename ST>
	reader operator<<(ST x){
		if(typeid(x)==typeid(int)||typeid(x)==typeid(ll)||typeid(x)==typeid(u)||typeid(x)==typeid(ull)){
			int num[30],sp=0;
			if(x<0)*T++='-',x=-x;
			if(!x)*T++=48;
			while(x)num[++sp]=x%10,x/=10;
			while(sp)*T++=num[sp--]+48;
		}
		else if(typeid(x)==typeid(char)){
			*T++=x;
		}
		else if(typeid(x)==typeid(char*)){
			while(!isspace(x))*T++=x,x++;
		}
		return*this;
	}
}read;
int main(){
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
	fread(buffer,1,sizeof buffer,stdin);
	long long a;
	int b;
	char ch[10];
	read>>*ch<<*ch;
	fwrite(puffer,1,T-puffer,stdout);
}
2020/12/4 08:11
加载中...