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

不好意思 那个if 的确没用 当时犯傻了 ^_^

Posted by zsl2007 at 2006-01-28 19:35:50 on Problem 1844
In Reply To:"nod" <hr> "后面那个if没用的 " Posted by:Judas at 2006-01-02 19:18:33
这样最准确
#include<stdio.h>
int main()
{  
   int s,i,sum=0;
   scanf("%d",&s); 
	for(i=1;;i++)
	 {        sum+=i;
		 if(sum-s==0) break;	
		 else  if((sum-s)%2==0)
		         if((sum-s)/2>=1) break;
          }
	printf("%d\n",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