题意:如题。
#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);
}
}