【OI】快读

不必多说。

#include <cstdio>
#include <cstring>

int read(){
    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;
}

int main()
{
    for(int i = 1; i <= 5; i ++){
        int x = read();
        printf("%d",x);
    }
    
    
    return 0;
}
View Code

 

posted @ 2019-11-16 18:20  dudujerry  阅读(478)  评论(0编辑  收藏  举报