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:怎么会Time Limit Exceeded!高人指教啊。小弟菜,想了许久依然茫然……

Posted by 052493 at 2008-09-17 21:44:41 on Problem 1003
In Reply To:怎么会Time Limit Exceeded!高人指教啊。小弟菜,想了许久依然茫然…… Posted by:crg511 at 2008-04-28 10:05:57
> #include <stdio.h>
> void main()
> {
>   int j;
>   float a,i,sum;
>   scanf("%.2f",&a);
>   while(a!=0.00)
>      { sum=0.00;
>        for(i=2.00;(sum+=1/i)>a;i++);
>        j=i;
>        printf("%d card(s)\n",j);
>        scanf("%.2f",&a);
>       }
>  }
>  scanf("%.2f",&a);改一下了 scanf("%f",&a);
(sum+=1/i)>a这一句就不合逻辑,(sum+=1/i)《=a




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