快读
inline int read(){
int x=0;bool f=1;char s=getchar();
while(s<'0'||s>'9'){if(s=='-')f=0;s=getchar();}
while(s>='0'&&s<='9'){x=(x<<1)+(x<<3)+(s^48);s=getchar();}
return f?x:-x;
}
inline double fread() {//浮点数
double x = 0, y = 1.0;
char c = getchar();
while (c<'0'||c>'9') {
if (c == '-') y = -1.0;
c = getchar();
}
while (c>='0'&&c<='9' || c == '.') {
if (c>='0'&&c<='9') x = x * 10 + c - '0';
else {
double t = 0.1;
c = getchar();
while (isdigit(c)) {
x += (c - '0') * t;
t *= 0.1;
c = getchar();
}
break;
}
c = getchar();
}
return x * y;
}
快写
inline void write(int x) {
if (x < 0) putchar('-'), x = -x;
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
}
标签:int,write,while,&&,快读,模板,getchar
From: https://www.cnblogs.com/GOD-HJ/p/17366408.html