Luoqiu19 @ 2019-11-04 19:02:41
int main() { int n,k; double m; double sum=0;
scanf("%d",&k);
for(n=1;sum<=k;n++)
{
m=1/n;
sum+=m;
}
printf("%d",n-1);
}
by jxyzs @ 2019-11-04 19:04:10
@Luoqiu19 1/n,整数和整数,结果会是整数
by Luoqiu19 @ 2019-11-04 19:04:53
@jxyzs 好的谢谢大佬:)
by jxyzs @ 2019-11-04 19:05:07
还有 希望更丰富的展现?使用Markdown