[模板]快读数字

快读数字模板

 

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

 

posted @ 2023-09-04 10:09  Happydaylhp  阅读(2)  评论(0编辑  收藏  举报