Untitled
raw download clone
TEXT
views 14
,
size 338 b
#include <iostream>

using namespace std;

int findFact(int n)
{
    return n == 1 ? 1 : n * findFact(n - 1);
}

long long int findNpK(int n, int k)
{
    return findFact(n) / findFact(n - k);
}

int main()
{
    long long int n, k, nPk;

    cin >> n;

    cin >> k;

    nPk = findNpK(n, k);

    cout << nPk;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.