Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
45329 张俊杰 求解函数 C++ Accepted 2 MS 300 KB 317 2023-03-18 16:25:40

Tests(10/10):


Code:

#include<iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; double f(double x,double n){ if(n==1){ return x/(x+1); } else{ return x/(n+f(x,n-1)); } } int main(){ double x,n; cin>>x>>n; printf("%.2lf",f(x,n)); return 0; }