1 inline int read(int &x) 2 { 3 int k=0; 4 char f=1; 5 char c=getchar(); 6 while(c>'9'||c<'0') 7 if(c=='-') 8 { 9 f=-1; 10 c=getchar(); 11 } 12 while(c<='9'&&c>='0') 13 { 14 k=k*10+c-'0'; 15 c=getchar(); 16 } 17 x = k*f; 18 }
1 inline int read(int &x) 2 { 3 int k=0; 4 char f=1; 5 char c=getchar(); 6 while(c>'9'||c<'0') 7 if(c=='-') 8 { 9 f=-1; 10 c=getchar(); 11 } 12 while(c<='9'&&c>='0') 13 { 14 k=k*10+c-'0'; 15 c=getchar(); 16 } 17 x = k*f; 18 }