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 |
一次性AC,0MSIn Reply To:庆祝,一次性AC,0MS,哈哈,贴下代码 Posted by:denganliang at 2011-03-13 16:42:33 #include<stdio.h> int main() { int i; double sum ,n; while(scanf("%lf",&n),n) { sum=0; for(i=1;i;i++) { sum+=1.0/(i+1); if(sum-n>=0) {;break;} } printf("%d card(s)\n",i); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator