嗯~~~这俩玩意 很毒瘤,但是也很管用
我的某位超级巨的巨佬有一次因为用了快读,莫名其妙变30分,啦啦啦~~~
下面让我们来看看正确的快读快写
1 int buf[17]; 2 inline void read(int &x){ 3 char ch=getchar(); x=0; 4 while(ch<‘0‘) ch=getchar(); 5 while(ch>=‘0‘ && ch<=‘9‘) x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); 6 } 7 inline void write(int x){ 8 if(!x){putchar(‘0‘);putchar(‘ ‘);return;} 9 register int cnt=0; 10 while(x)buf[++cnt]=(x%10)+48,x/=10; 11 while(cnt)putchar(buf[cnt--]); 12 putchar(‘\n‘); 13 }
这才对嘛很管用!!!
不要像某位巨佬一样哦~~~
原文:https://www.cnblogs.com/wangyifan124/p/10319878.html