L4_T2
unknown
c_cpp
3 years ago
356 B
8
Indexable
#include <iostream>
#include <cmath>
using namespace std;
double RecrsP(int n)
{
return n > 1 ? pow(2*n, n) * RecrsP(n - 1) : 1;
}
int main()
{
int n;
while(true)
{
cout << "enter n: " << endl;
cin >> n;
if(n > 0) break;
cout << "Incorrect input values!";
}
cout << RecrsP(n);
return 0;
}Editor is loading...