首页 > 其他 > 详细

快读板子fread

时间:2019-02-19 19:37:51      阅读:561      评论:0      收藏:0      [点我收藏+]
 1 struct ios {
 2     inline char read(){
 3         static const int IN_LEN=1<<18|1;
 4         static char buf[IN_LEN],*s,*t;
 5         return (s==t)&&(t=(s=buf)+fread(buf,1,IN_LEN,stdin)),s==t?-1:*s++;
 6     }
 7 
 8     template <typename _Tp> inline ios & operator >> (_Tp&x){
 9         static char c11,boo;
10         for(c11=read(),boo=0;!isdigit(c11);c11=read()){
11             if(c11==-1)return *this;
12             boo|=c11==-;
13         }
14         for(x=0;isdigit(c11);c11=read())x=x*10+(c11^0);
15         boo&&(x=-x);
16         return *this;
17     }
18 } io;
19 
20 int main(){io>>a>>b;}

 

快读板子fread

原文:https://www.cnblogs.com/xyq0220/p/10402954.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!