快读

 1 #include<bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 int read(){
 6     int x = 0,flag = 1;
 7     char ch = getchar();
 8     while(!isdigit(ch)){
 9         if(ch == '-'){
10             flag = -1;
11         }
12         ch = getchar();
13     }
14     while(isdigit(ch)){
15         x = (x<<3) + (x<<1) + (ch^48);
16         ch = getchar();
17     }
18     return x*flag;
19 }
20 
21 int main(){
22     int x = read();
23     cout << x << endl;
24     return 0;
25 }
原文地址:https://www.cnblogs.com/zhangqiling/p/12460784.html