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 |
苍天了,这题也太水了,5分钟AC#include<stdio.h> int main() { int i,n,k; long float sum; printf("Cards Overhang\n"); while(scanf("%d",&n)!=EOF){ k=2; for(i=1,sum=0;i<=n;i++){ sum+=1.0/k; k+=2; } printf("%5d",n); printf(" %9.3f\n",sum); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator