竞赛
考级
#include <iostream> using namespace std; int main(){ double k,s,a; a=0; s=0; cin>>k; while (s<=k){ a=a+1; s=s+1/a; } cout<<a<<endl; return 0; }
蜂神演医.盛世大唐
zsy
私密马赛
潜龙暗虎
#include<bits/stdc++.h> using namespace std; int main(){ int k,n=2; double s=1.0; cin>>k; while(s<=k){ s+=1.0/n; n+=1; } cout<<n-1; return 0; }
fAulT BlOcK
#include <iostream> using namespace std; int main() { int k,i; double n=0; cin>>k; for(i=1;;i++) { n=1.0/i+n; if(n>k) break; } cout<<i; }
137****7090
#include<iostream> using namespace std; int main(){ int k; double sum=0.0,i=0.0; cin>>k; while(1){ i+=1; sum+=1/i; if(sum>k) {cout<<i;break;} } return 0; }
187****1701
#include<iostream> using namespace std; int main(){ int k; float Sn=1; int i=1; float c=1.0; cin>>k; if(k>=1&&k<=15){ while(Sn<=k){ i++; Sn=Sn+(c/i); } cout<<i;} return 0; }
彭思迪
???
枫岚
共30条
提交答案之后,这里将显示提交结果~