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:请高手来看看,为什么这个总是wrong answer?

Posted by alpha_tanying at 2009-03-05 16:59:13 on Problem 1003
In Reply To:请高手来看看,为什么这个总是wrong answer? Posted by:yelin at 2009-03-05 16:47:40
> #include<stdio.h>
> int main()
> {
>     double i=1;
> 	double len,sum=0;
> 	scanf("%lf",&len);
> 	if(len>=0.01&&len<=5.20)
> 	{
> 		while(sum<=len)
>            {
> 		i++;
> 		sum=sum+(1/i);
> 	    }
> 	printf("%d card(s)\n",(int)(i-1));
> 	}
> 	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