Chtholly_NS @ 2019-08-15 16:54:28
#include<stdio.h>
int main() {
int K, n;
double S = 0;
scanf("%d",&K);
for (n = 1; S <= K * 1.0; n++) {
S += 1.0 / n;
}
printf("%d", n);
getch();
}
不知道哪里逻辑错误了,小白求助5555
by 学而思李老师 @ 2019-08-15 17:02:06
你应该printf n + 1