怎么写呢?
查看原帖
怎么写呢?
1128297
ZiruiLIU楼主2024/6/9 19:22

TLE呀,好久不见;

习惯性地打“;”;


言归正传;

到底该怎么写呢?;

是个好问题;


好了不开玩笑了; 上代码;

#include<bits/stdc++.h>
using namespace std;
int n;
double x;
double dfs(int n,double x){
	if(n==1){
		return 1+x;
	}
	else{
		return n+x/dfs(n-1,x);
	}
}
int main(){
    cin>>n>>x;
   printf("%.2f",dfs(n,x));
	return 0;
}

提示:c++;

测试点

我的c++页面

2024/6/9 19:22
加载中...