#include<iostream.h> int main() { float sum=0,n=1,limit; cout<<"请输入一个limit数:"<<endl; cin>>limit; while(sum<=limit) { sum=sum+1/n; n++; } cout<<n<<endl; return 0; }