Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
242 | ZRH | 求解函数 | C++ | Accepted | 0 MS | 296 KB | 445 | 2022-07-22 10:54:56 |
#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; double t(double x,double n){ if(n==1){ return x/(x+1); } else{ return x/(n+t(x,n-1)); } } int main(){ int x,n; cin>>x>>n; printf("%.2lf",t(x,n)); return 0; }