L4_T2

mail@pastecode.io avatar
unknown
c_cpp
a year ago
356 B
1
Indexable
Never
#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;
}