【模板】 快读快写模板

快读:

inline int read(){
    char c = getchar();int x = 0,s = 1;
    while(c < '0' || c > '9') {if(c == '-') s = -1;c = getchar();}
    while(c >= '0' && c <= '9') {x = x*10 + c -'0';c = getchar();}
    return x*s;
}

快写:

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

 都挺简单的所以没加注释qwq

posted @ 2022-07-11 21:57  chengjiayi1018  阅读(49)  评论(0编辑  收藏  举报