快读快输板子

快读

int read(){
    int w=1,q=0;char ch=' ';
    while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar();
    if(ch=='-')w=-1,ch=getchar();
    while(ch>='0'&&ch<='9')q=q*10+ch-'0',ch=getchar();
    return w*q;
}

快输

int write(int x)
{
    if(x<0){puctahr('-');x=~(x-1);}
    int s[20],top=0;
    while(x){s[++top]=x%10;x/=10;}
    if(!top)s[++top]=0;
    while(top)putchar(s[top--]+'0');
}

猜你喜欢

转载自blog.csdn.net/balalalalalalala/article/details/81869016
今日推荐