Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int factor(int n) {
- int sum = 1;
- for (int i = 1; i < n; i++) {
- sum += i * sum;
- }
- return sum;
- }
- int main() {
- int c, n, m;
- cout << "Введите кол-во человек: ";
- cin >> m;
- cout << "Введите кол-во кандитатов: ";
- cin >> n;
- cout << "Способов отобрать команду в составе " << m << " человек из " << n << " кандитатов: " << factor(n) / factor(m) * factor(n-m);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement