| ||||||||||
| 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:水题,markIn Reply To:水题,mark Posted by:isjune at 2015-06-04 09:24:28 > #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