Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
112761 | 小徐老师 | 求解函数 | C++ | Accepted | 1 MS | 292 KB | 294 | 2025-03-11 20:13:32 |
#include <bits/stdc++.h> using namespace std; double f(int x, int n) { if(n == 1) return 1.0 * x / (1 + x); return x / (n + f(x, n - 1)); } int main() { int x, n; cin >> x >> n; cout << fixed << setprecision(2) << f(x, n) << '\n'; return 0; }