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

注意这道题输入占1秒时间,最好自己写输入函数,另外用ll做随机的话一次就应该过

Posted by Shinjikun at 2009-09-15 17:08:33 on Problem 3318
不介意的话用下面这个:

char get1char()
{
	static char buffer[5600];
	static int cnt;
	if(buffer[cnt]==0)
	{
		gets(buffer);
		cnt = 0;
		return '\n';
	}
	return buffer[cnt++];
}

int readInt()
{
	int i = 0;
	bool positive = true;
	char ch = get1char();
	while(ch==' '||ch=='\n')ch=get1char();
	if(ch == '-') 
	{
		positive = false;
		ch = get1char();
	}
	while(ch<='9' && ch>='0')
	{
		i*=10;
		i+=ch-'0';
		ch=get1char();
	}
	if(positive)
		return i;
	return -i;
}

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