View Code of Problem 610

#include <bits/stdc++.h>
using namespace std;

int lines(int n) {
	if (n == 0) return 1;
	else return 2 * (2 * n - 1)*lines(n - 1) / (n + 1);
}

int main() {
	int n;
	while (cin >> n) {
		cout << lines(n) << endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 610