#include<iostream>
using namespace std;
int Factorial(int num) {
if (num == 1 || num == 0) {
return 1;
}
else {
return Factorial(num - 1) * num;
}
}
int main() {
int n, k;
cin >> n >> k;
cout << Factorial(n) / (Factorial(k) * Factorial(n - k));
return 0;
}
'Language > C++' 카테고리의 다른 글
Exchange, Insertion, Selection, Merge, Quick, Shell Sort Algorithms (0) | 2023.03.16 |
---|---|
Let's measure time complexity by n^3 and 2^n (0) | 2023.03.06 |
[C++ / 백준 1934] 최소공배수 (0) | 2021.08.20 |
[C++ / 백준 2609] 최대공약수와 최소공배수 (0) | 2021.08.19 |
[C++ / 백준 1037] 약수 (0) | 2021.08.18 |