void read(int &x)
{
int f=1;x=0;char s=getchar();
while(s<‘0‘||s>‘9‘){if(s==‘-‘)f=-1;s=getchar();}
while(s>=‘0‘&&s<=‘9‘){x=x*10+s-‘0‘;s=getchar();}
x*=f;
}
void print(int x)
{
if(x<0)putchar(‘-‘),x=-x;
if(x>9)print(x/10);
putchar(x%10+‘0‘);
}
并不太想用这种技巧(但万一压线过了呢
原文地址:https://www.cnblogs.com/orangee/p/9500603.html
时间: 2024-11-02 15:49:56