소감

코드

~cpp 
#include <iostream>
using namespace std;

void find_combination(int n, int c);

int main()
{
	int row, col;
	cin >> row >> col;
	find_combination(row, col);
	return 0;
}

void find_combination(int n, int c)
{
	if (n == 0 || c == 0)
	{
		cout << 1 << endl;
		return;
	}
	int num = 1;
	for (int i = n; i > c; i--)
		num *= i;
	for (i = n - c; i >= 2; i--)
		num /= i;
	cout << num << endl;
}

나한테 할 말

Retrieved from http://wiki.zeropage.org/wiki.php/파스칼삼각형/문보창
last modified 2021-02-07 05:31:23