Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:我是这么处理那个恶心的输入的……

Posted by 740340735 at 2012-08-16 15:44:39 on Problem 1470
In Reply To:我是这么处理那个恶心的输入的…… Posted by:393570442 at 2011-09-27 18:00:59
int get(){
	char ch=getchar();
	while(ch<'0'|| ch>'9') ch=getchar();
	int x=0;
	while(ch>='0' && ch<='9'){
		x*=10;
		x+=ch-'0';
		ch=getchar();
	}
	return x;
}

字符读入格外好用,而且很快~~

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator