读入挂

static inline int Rint() {
    struct X{
        int dig[256];
        X() {
            rep(i,'0','9'){
                dig[i]=1;dig['-']=1;
            }
        }
    };
    static X fuck;
    int s=1,v=0,c;
    for(;!fuck.dig[c=getchar()];);
    if(c=='-') s=0;
    else if(fuck.dig[c]) v=c^48;
    for(;fuck.dig[c=getchar()];v=v*10+(c^48));
    return s?v:-v;
}

你可能感兴趣的:(算法-一)