Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int c(int n, int m) {
- if (m == 0 || n == m) return 1;
- return c(n - 1, m) + c(n - 1, m - 1);
- }
- int main() {
- for (int i = 1; i < 5; i++) {
- for (int j = i + 1; j < 10; j++) {
- cout << "C n=" << j << " m=" << i << " : " << c(j, i) << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement