快速读入

 1 记得加上一个头文件
 2 #include<cctype>
 3 inline void read(int& x)
 4 {
 5    x=0;
 6    register char f=getchar(),c=0;
 7    while(!isdigit(f)&&f!='-')
 8    f=getchar();
 9    if(f=='-')
10    c=1,f=getchar();
11    while(isdigit(f))
12    x=x*10+(f^48),f=getchar();
13    if(c)
14    x=~x+1;
15 }
原文地址:https://www.cnblogs.com/Hammer-cwz-77/p/8125252.html