【快读】快速读入,快速输出

char buf[1<<15],*fs,*ft;
inline char getc(){return (fs==ft&&(ft=(fs=buf)+fread(buf,1,1<<15,stdin),fs==ft))?0:*fs++;}
inline int read(){
    int x=0,f=1;  char ch=getc();
    while(!isdigit(ch))  {if(ch=='-')  f=-1;  ch=getc();}
    while(isdigit(ch))  {x=x*10+ch-'0';  ch=getc();}
    return x*f;
}
void put(int x)  
{
    if(x==0)
    {
        putchar('0');
        putchar('\n');
        return;
    }
    if(x<0)  putchar('-'),x=-x;
    int num = 0; char c[15];
    while(x) c[++num] = (x%10)+48, x /= 10;
    while(num) putchar(c[num--]);
    putchar('\n');
}

 

posted @ 2017-05-05 15:11  Strork  阅读(496)  评论(0编辑  收藏  举报