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

为什么WA呢?一样的题在另一个oj上AC,在这就WA?

Posted by guixin at 2012-04-16 22:52:45 on Problem 1607
#include<stdio.h>
int main()
{
    int n,k,i,m=1;
    double sum;
    while(~scanf("%d",&n))
    {
      k=1;
      for(i=1;i<=n;i++)
      {
        k=2*i;
        sum=sum+1/(k*1.0);
      }
      if(m==1)
      {
      printf("Cards  Overhang\n");
      m=0;
      }
      printf("%5d%10.3lf\n",n,sum);
      sum=0;
    }
    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