读入优化摸板

void read(int& x) //isdigit头文件  cctype
{
	int f = 1; x = 0; char ch = getchar();
	while(!isdigit(ch)) { if(ch == '-1') f = -1; ch = getchar(); }
	while(isdigit(ch)) { x = x * 10 + ch - '0'; ch = getchar(); }
	x *= f;
}

 

posted @ 2018-09-14 21:04  Sugewud  阅读(104)  评论(0编辑  收藏  举报