读入优化板子

#include<cstdio>
#define int long long
using namespace std;

inline void input(int &x){
    int ans=0,f=1;
    char c=getchar();
    while(c>'9'||c<'0'){
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        ans=ans*10+c-48;
        c=getchar();
    }
    x=ans*f;
}

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

inline void writeln(int x){
    output(x);
    putchar('\n');
}

int n;

signed main(){
    while(1){
        input(n);
        writeln(n);
    }
}

posted @ 2019-08-19 15:23  Y15BeTa  阅读(171)  评论(0编辑  收藏  举报