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

狂晕^^^^^偶的哪错了,高手们指点下…………呜呜………………

Posted by ecjtu_wangkun at 2007-12-08 13:02:36 on Problem 1844

#include<iostream>
using namespace std;
int main()
{
	int i,m,s;
	while(cin>>m)
	{
		s=0;
		for(i=1;s<m;i++)
		s+=i;
	    if((s-m)%2==0)
			cout<<(i-1)<<endl;
		else 
			cout<<(i+1)<<endl;
	
	}
	return 0;
}






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