水题,注意要用double类型,float并不能过
#include <cstdio>
#include <cstring>
#include <stdio.h>
#include <iostream>
using namespace std;
double a;
int main()
{
//freopen("in.txt","r",stdin);
while(scanf("%lf",&a)!=EOF)
{
// printf("%lf\n",a);
if(a==0.00)
break;
double sum=0;
int n=2;
while(sum<a)
{
sum+=(double)1/(double)n;
n++;
//printf("%lf\n",sum);
}
printf("%d card(s)\n",n-2);
}
}