求大佬们观赏60分的

P1035 [NOIP2002 普及组] 级数求和

2018陈子珺 @ 2018-09-07 13:21:43

include<iostream>

using namespace std; int main() { int k,n=0; float zong=0; cin>>k; while(zong<k) { ++n; zong+=1.0/n;

}
cout<<n;
return 0;

}


by Marser @ 2018-09-07 13:24:17

@2018陈子珺 float换成double


by 2018陈子珺 @ 2018-09-07 13:25:27

谢谢谢谢


|