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:菜鸟不会题In Reply To:菜鸟不会题 Posted by:198910208039 at 2010-12-04 16:10:11 > 挺难的啊,在下是一个菜鸟. #include<stdio.h> int main(void) { float i; while(scanf("%f",&i)==1) { float sum=0; int j=0,k=2; if(i==0.00) return 0; do {sum+=(float)1/k; k++; j++; } while (sum<i); printf("%d card(s)\n",j); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator