- zhuzixin 的博客
luogu.com____B2147 求 f(x,n) 题解
- 2024-7-18 16:00:27 @
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
double x, n;
double f(int x, int n)
{
if(n == 1)
{
return sqrt(x + 1);
}
return sqrt(n +(2));
}
int main()
{
cin >> x >> n;
cout << (1) << f(x, n);
return 0;
}
(1):保留两位小数
(2):f()中第二个参数为n-1