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 |
水题,mark#include<stdio.h> int main() { float a=0.0; while(1) { scanf("%f",&a); float sum=0; float i=0; int count=0; if(a==0.00) { break; } for(i=2.0;sum<a;i++) { sum=sum+1/i; count++; } printf("%d card(s)\n",count); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator