快讀模板--zhengjun

#define print(x) if(!x)putchar('0');else write(x)
template<typename item>
inline void read(register item &x){
	x=0;register char c=getchar();register bool f=0;
	while(c<'0'||c>'9'){if(c=='-')f=1;c=getchar();}
	while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();
	if(f)x=-x;
}
template<typename item>
void write(register item x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)print(x/10);
	putchar(x%10+'0');
}
template<typename item>
inline void uread(register item &x){
	x=0;register char c=getchar();
	while(c<'0'||c>'9')c=getchar();
	while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();
}
template<typename item>
void uwrite(register item x){
	if(x>9)print(x/10);
	putchar(x%10+'0');
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章