我的快读快写:顺便问问还可以更快吗
template <class T> inline void read(T &x) {
x=0;
T f=1;
char ch=getchar();
while(!isdigit(ch)) {
if(ch=='-')f=-1;
ch=getchar();
}
while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
x*=f;
}
template <class T> inline void write(T x) {
if(x<0)putchar('-'),x=-x;
if(x>9)write(x/10);
putchar(x%10+'0');
}
用法:
read(n);
write(n):