快读快输

template<typename T>void read(T &x)
{
    x=0;int f=1;char c=getchar();
    while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
template<typename T>void print(T x)
{
    if(x<0)putchar('-'),x=-x;
    if(x>9)print(x/10);
    putchar(x%10+48);
}

可读入int型,long long型。

posted @ 2019-01-29 14:56  南柯一场  阅读(169)  评论(0编辑  收藏  举报