模板 - 快速输入输出

非负整数的快速输入输出

inline int read(){
    int x=0;
    char c=getchar();
    while(c<'0'||c>'9')
        c=getchar();
    do{
        x=(x<<3)+(x<<1)+c-'0';
        printf("x=%d\n",x);
        c=getchar();
    }while(c>='0'&&c<='9');
    return x;
}

inline void write(int x){
    if(x>9){
        write(x/10);
    }
    putchar(x%10+'0');
    return;
}

猜你喜欢

转载自www.cnblogs.com/Yinku/p/10987283.html