Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
100704 asfd 求解函数 C++ Accepted 1 MS 292 KB 255 2024-12-11 19:46:37

Tests(10/10):


Code:

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