huhu

 avatar
NguyenAnhQuan
c_cpp
2 years ago
391 B
6
Indexable
#include <iostream>
#include <iomanip>
using namespace std;

// toikhongmuonhocbichvantoikhongmuonhocbichvan



#include <math.h>

float calculate(int n)
{
	if (n == 1) return 1;

	return sqrt(n + calculate(n - 1));
}

// toikhongmuonhocbichvantoikhongmuonhocbichvan

int main() {
	int n;
	cin >> n;
    cout <<fixed<<setprecision(2)<< calculate(n);
    return 0;
}
Editor is loading...