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:找了个读入优化,T了,scanf就A了

Posted by w007878 at 2014-02-26 22:36:34 on Problem 3349
In Reply To:找了个读入优化,T了,scanf就A了 Posted by:justryit at 2013-08-06 14:28:06
判断太多了……我习惯这么写
inline int getint()
{
	int ans(0); char w = getchar();
	while(w < '0' || '9' < w)w = getchar();
	while('0' <= w && w <= '9')
	{
		ans = ans * 10 + w - '0';
		w = getchar();
	}
	return ans;
}
确实比scanf快一些,仅供参考

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