标签:for printf scan while can cst int break oid
#include <cstdio>
void main()
{
double length;
double l[300];
l[1] = 1.0/2;
int i;
for (i = 2;; ++i)
{
l[i] = l[i-1] + 1.0/(i+1);
if (l[i] >= 5.20)
break;
}
while (scanf("%lf", &length), length > 0)
{
for (i = 1;; ++i)
{
if (l[i] >= length) break;
}
printf("%d card(s)\n",i);
}
}
标签:for printf scan while can cst int break oid
原文地址:http://www.cnblogs.com/wangkun1993/p/6298663.html