Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
17214 | 周楷程 | 求解函数 | C++ | Accepted | 5 MS | 792 KB | 199 | 2021-09-04 16:24:03 |
#include<iostream> using namespace std; double f(double x,double n) { if(n<=1) return x/(1+x); else return x/(n+f(x,n-1)); } int main() { int x,n; cin>>x>>n; printf("%.2f",f(x,n)); }