mod巨佬测试点三绿两红 wa的都是大的点
查看原帖
mod巨佬测试点三绿两红 wa的都是大的点
1097758
CrNidaree楼主2023/9/19 20:39
#include<bits/stdc++.h>
using namespace std;
inline int read()
{  int s=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
   while(c>='0'&&c<='9'){s=s*10+c-'0';c=getchar();}return s*f;
}
int main(){
	int k=read();
	float s=0.0;
	for(double i=1;;i++){
		s+=1/i; 
		if(s>k){cout<<i;break;}
	}
	
	return 0; 
} 
2023/9/19 20:39
加载中...