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

谁能帮我改一下,把正确的贴出来,是C的。谢谢!

Posted by boss185 at 2006-12-20 13:31:49 on Problem 1003
#include <stdio.h>
#include <math.h>

int main()
{
   float c,sum;
   int n;
   
   scanf ("%f",&c);

   while (fabs(c) < 0.001) { 
      n = 1;
      for (sum = 0;sum < c;n++)
         sum += 1 / (n + 1);
      printf ("%d card(s)\n",n);
      scanf ("%f",&c);
   }

   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