快速读入模版

template < class T > inline void read(T &x) {
    x = 0;
    char c = getchar();    
    bool f = 0;
    while (!isdigit(c)) {
        f ^= c == '-';
        c = getchar();
    }
    while (isdigit(c)) {
        x = (x << 3) + (x << 1) + (c ^ 48);
        c = getchar();
    }
    if (f)
        x = ~x + 1;
}

快速输出模版

template < class T > inline void print(T x) {
    if (x < 0) {
        putchar('-');
        x = ~x + 1;
    }
    if (x > 9)
        print(x / 10);
    putchar(48 + x % 10);
}
内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!

相关课程

3598 0元 98元 限免
3689 9.31元 9.8元 9.5折