fread()快读

摘自博客:https://www.cnblogs.com/ErkkiErkko/p/9329123.html

struct ios{
    inline char read(){
        static const int IN_LEN=1<<18|1;
        static char buf[IN_LEN],*s,*t;
        return (s==t)&&(t=(s=buf)+fread(buf,1,IN_LEN,stdin)),s==t?-1:*s++;
    }
    template <typename _Tp> inline ios & operator >> (_Tp&x){
        static char c11,boo;
        for(c11=read(),boo=0;!isdigit(c11);c11=read()){
            if(c11==-1)return *this;
            boo|=c11=='-';
        }
        for(x=0;isdigit(c11);c11=read())x=x*10+(c11^'0');
        boo&&(x=-x);
        return *this;
    }
}io;

int n,m;
int main()
{
  io>>n>>m;
  printf("%d%d",n,m);
}

 

posted @ 2018-10-08 15:44  radishえらい  阅读(1913)  评论(0编辑  收藏  举报