Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97997 | 刘轻松 | 求解函数 | C++ | Accepted | 1 MS | 292 KB | 243 | 2024-11-17 10:18:31 |
#include<bits/stdc++.h> using namespace std; double f(int x,int n){ if(n==1){ return x*1.0/(x+1); } else{ return x*1.0/(n+f(x,n-1)); } } int main(){ int x,n; double a; cin>>x>>n; a = f(x,n); printf("%.2lf",a); }