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 |
谁能帮我改一下,把正确的贴出来,是C的。谢谢!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator