
Kovanlina
6 год назад
Пожалуйста посчитайте пожалуйста!! Срочно надо! С++

ОТВЕТЫ

Elisej
Oct 24, 2020
#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265
double f(int n, double x)
{
double p = (double) tan(n * PI / 2 + x);
if (n == 1)
{
return p;
}
else
{
return f(n - 1, p);
}
}
int main()
{
cout << "n = ";
int n;
cin >> n;
cout << "x = ";
double x;
cin >> x;
cout << ": " << f(n, x) << endl;
return 0;
}
#include <math.h>
using namespace std;
#define PI 3.14159265
double f(int n, double x)
{
double p = (double) tan(n * PI / 2 + x);
if (n == 1)
{
return p;
}
else
{
return f(n - 1, p);
}
}
int main()
{
cout << "n = ";
int n;
cin >> n;
cout << "x = ";
double x;
cin >> x;
cout << ": " << f(n, x) << endl;
return 0;
}
919
Смежные вопросы: