Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137644 小徐老师 求解函数 C++ Accepted 1 MS 296 KB 285 2025-11-21 21:04:32

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; float f(int x, int n) { if(n == 1) return 1.0 * x / (1 + x); return 1.0 * x / (n + f(x, n - 1)); } int main() { int x, n; cin >> x >> n; //cout << f(x, n) << endl; printf("%.2f\n", f(x, n)); return 0; }