零分求助
查看原帖
零分求助
950713
IAKIOI14141楼主2023/5/23 17:48
#include<iomanip>
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n=1;
	double s=1.0*0;
	int k;
	int i=0;
	cin>>k;
	while(s<=double(1.0*k)){
		s=s+1.0/i++;
	}
	cout<<i<<endl;
	return 0;
}
2023/5/23 17:48
加载中...