Hoyu_M @ 2017-07-30 15:55:07
#include <iostream>
#include <cstdio>
using namespace std ;
int main()
{
float n,s;
int i=0,k;
scanf("%d",&k);
while(s<=k)
{
i++;
s=s+1/(float)i;
}
printf("%d",i);
}
by 鬼_ @ 2017-07-30 18:49:43
把float改double
by AsukaMinato @ 2017-08-01 17:59:51
我一开始也只有60分,这是因为float不够精确,要用double。