- 龙凤苑中学B班5.21
级数求和
- @ 2024-5-21 17:54:56
#include <bits/stdc++.h>
using namespace std;
double n,d,sum=0;
int k;
int main() {
cin>>k;
for(double i=1;;i++){
d=i;
sum+=1.0/d;
if(sum>k) break;
}
cout<<d;
return 0;
}
0 comments
No comments so far...