U E D R , A S I H C RSS

파스칼삼각형/Leonardong

No older revisions available

No older revisions available



데블스 캠프 첫째날 파스칼삼각형 코드

~cpp 
#include <iostream>
using namespace std;
int Pas(int, int);

int main()
{
	int x,y;
	cin >> x >> y;
	cout << Pas(x,y);

	return 0;
}

int Pas(int x, int y)
{
	if (y==1)
		return 1;
	if (x==y)
		return 1;
	return Pas(x-1, y-1)+Pas(x-1, y);
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:22
Processing time 0.0267 sec