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 |
请高手来看看,为什么这个总是wrong answer?#include<stdio.h> int main() { double i=1; double len,sum=0; scanf("%lf",&len); if(len>=0.01&&len<=5.20) { while(sum<=len) { i++; sum=sum+(1/i); } printf("%d card(s)\n",(int)(i-1)); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator