MLE
查看原帖
MLE
561043
足球小子楼主2024/10/7 13:14
#include<bits/stdc++.h>
using namespace std;

double x;
int n;

double solve(int now)
{
	if(now==1)
		return x/(1+x);
	return x/(1.0*n+solve(n-1));
}

int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	cin>>x>>n;
	cout<<fixed<<setprecision(2)<<solve(n);
	return 0;
}

2024/10/7 13:14
加载中...