Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么WA呢?一样的题在另一个oj上AC,在这就WA?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator