标签:pre bsp getc int tchar class getchar return get
1 int read(){ 2 int x=0,f=1; 3 char ch=getchar(); 4 while(ch<‘0‘||ch>‘9‘){ 5 if(ch==‘-‘) 6 f=-1; 7 ch=getchar(); 8 } 9 while(ch>=‘0‘&&ch<=‘9‘){ 10 x=(x<<1)+(x<<3)+(ch^48);//就是乘以10再转int 11 ch=getchar(); 12 } 13 return x*f; 14 }
标签:pre bsp getc int tchar class getchar return get
原文地址:https://www.cnblogs.com/zhmlzhml/p/13287812.html