2022:【例4.7】最小n值
时间:2024-06-21 16:01
作者:lizq
点击:次
#include iostreamusing namespace std;int main(){ int a; double b=1; double c=0; cina; while(ca){ c=c+1/b; b=b+1; } coutb-1; return 0;}
#include <iostream>
using namespace std;
int main(){
int a;
double b=1;
double c=0;
cin>>a;
while(c<a){
c=c+1/b;
b=b+1;
}
cout<<b-1;
return 0;
}
(责任编辑:lizq) |