Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int fak(int x) {
- int temp = x;
- while (temp != 1) {
- x *= (temp - 1);
- temp--;
- }
- return x;
- }
- int main() {
- int k, n;
- cout << "N: ";
- cin >> n;
- cout << endl << "k: ";
- cin >> k;
- cout << "Rezultat: " << fak(n)/(fak(k)*fak(n-k));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement