Run ID:147021

提交时间:2026-02-02 11:18:19

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; double w(double n,double x){ if(n==1)return x/(1+x); else return x/(n+w(x,n-1)); } int main(){ double x,n; cin>>x>>n; printf("%.2lf\n",w(x,n)); return 0; }