Chunfei @ 2023-05-26 16:43:48
#include<iostream>
using namespace std;
int main(){
int k;
float a=0,n=0;
cin>>k;
while(a<=k)
n++,a+=1/n;
cout<<int(n);
return 0;}
by lupipi01 @ 2023-05-26 16:50:24
把float换成double就行了
by Chunfei @ 2023-05-31 17:28:11
@lupipi01 谢谢。