Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
41927 陈栋 求解函数 C++ Accepted 2 MS 292 KB 225 2022-11-11 20:56:59

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; double x,n; double mai(double n){ if(n==1) return x/(n+x); else return x/(n+mai(n-1)); } int main(){ cin>>x>>n; cout<<fixed<<setprecision(2)<<mai(n); return 0; }