| ||||||||||
| 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 | |||||||||
Re:靠~~没看见后面还要输出card(s),杯具的浪费了我的submissionIn Reply To:靠~~没看见后面还要输出card(s),杯具的浪费了我的submission Posted by:pfa2008 at 2010-05-27 10:21:54 #include <stdio.h>
int main()
{
float c;
float res;
int cards;
while(scanf("%f",&c)!=EOF)
{
if(c==0.00)
break;
cards=0;
res=0;
while((res+=1.0/float(++cards+1))<=c);
printf("%d card(s)\n",cards);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator