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 |
大家谁有能力帮我呀?#include <stdio.h> #include <math.h> void main() { float a,sum; int n; scanf("%f",&a); while (a!=-1){ sum=0; for(n=2;sum<a;n++){ sum+=(float)1/n; } printf("%d card(s)\n",n-2); scanf("%d",&a); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator