U E D R , A S I H C RSS

파스칼삼각형/손동일

파스칼삼각형
------------


~cpp 

#include<iostream>
using namespace std;


int sdd(int x, int y);


void main()
{
	cout << "숫자를 입력 하세요~ " << endl;
	int a, b;
	cin >> a  >> b;
	cout << sdd(a,b);
}


int sdd(int x, int y)
{

	return (x<3)?1:(y<2?1:(y==x?1:sdd(x-1,y)+sdd(x-1,y-1)));

}



Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:23
Processing time 0.0152 sec