nanmuru @ 2024-10-25 19:09:20
#include<stdio.h>
int main()
{
double k,n;
double a=0;
double Sn=0;
scanf("%lf",&k);
for(n=1;;n++){
a=1/n;
Sn=a+Sn;
if(Sn>k){
printf("%lf",n);
break;
}
}
return 0;
}
by wuyouawa @ 2024-10-25 19:12:17
@nanmuru 1.0/n
by nanmuru @ 2024-10-25 19:16:49
@wuyouawa 改了也不对啊
by wuyouawa @ 2024-10-25 19:18:22
@nanmuru n应为int吧
by nanmuru @ 2024-10-25 19:21:01
@wuyouawa 我靠,对了,这有啥影响吗
by wuyouawa @ 2024-10-25 20:09:09
@nanmuru 你n肯定要是整数啊,输出格式说了是一个正整数
by wcr1 @ 2024-10-25 20:35:56
吧小剧场鼓风机大于二的就是从女方海豚就如同费用 @wuyouawa