Unverified Commit e7f2a1e5 authored by ir1d's avatar ir1d Committed by GitHub
Browse files

Update io.md

parent f3e41eb8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -57,10 +57,8 @@ int read(){

	while(ch>='0' && ch<='9') {//ch是数字时

		x=(x<<3)+(x<<1)+(ch^48);
		//将新读入的数字’加’在x的后面
		x=(x<<3)+(x<<1)+ch-'0';//将新读入的数字’加’在x的后面
		//x<<3==x*8  x<<1==x*2  所以(x<<3)+(x<<1)相当于x*10
		// 48 是 0 的 ASCII 这个数字有性质,异或相当于减
		//x是int 类型,char类型的ch和’0’会被自动转为其ASCII表中序号,相当于将ch转化为对应数字
		ch=getchar();//继续读入
	}