Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
19411 | 陈煊 | 求解函数 | C++ | Accepted | 2 MS | 796 KB | 192 | 2021-11-13 20:35:01 |
#include<iostream> using namespace std; double f(double x,int n){ if(n==1) return x/(x+1); else return x/(n+f(x,n-1)); } int main(){ int a,b; cin>>a>>b; printf("%.2f",f(a,b)); }