C++ :
#include<bits/stdc++.h> using namespace std; int main(){ double sum=0,d=1; int x; cin>>x; while(x>sum){ sum+=1/d; d++; } if(d==2)d++; cout<<d-1; return 0; }
使用您的 Hydro 通用账户