2417323086qqwwqq @ 2017-08-30 19:38:51
#include<stdio.h>
int main()
{
int n=1,k;
float Sn=1;
scanf("%d",&k);
while(Sn<=k)
{n++;
Sn=Sn+1.0/n;
}
printf("%d",n);
return 0;
}
by 老K @ 2017-08-30 19:59:20
@2417323086qqwwqq 开double试试。
by 2417323086qqwwqq @ 2017-08-31 20:59:50
感谢大神
by 端端 @ 2017-09-04 18:39:06
1.0/n改成1.00/n试试