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

为什么总是 wrong Answer! 各位大侠帮帮我!快疯了,这也错了!

Posted by cao0303 at 2006-08-08 09:06:48 on Problem 1003
#include <stdio.h>
#define  zero 0.000001
main()
{
      float leng;
      float temp;
      int i;
      while(leng!=0)
      {
         scanf("%f",&leng);
         temp=0;
         for(i=1;i<32767;i++)
         {  if((temp-leng)>zero)
              {printf("%d card(s)\n",i-1);
               break;}
            temp=temp+1.00/(float)(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