More actions
imported>linflus No edit summary |
imported>linflus No edit summary |
||
| Line 1: | Line 1: | ||
~ | ~c | ||
#include <stdio.h> | #include <stdio.h> | ||
Revision as of 07:42, 10 September 2008
~c
- include <stdio.h>
int Pascal(int m, int n){ if(n>m) return -1; if(m == 1 || n == 1 || m == n) return 1; return Pascal(m-1, n-1) + Pascal(m-1, n); }
void main(){ int m,n; printf("행, 열 차례대로 입력 ex/3,2\n>>>>"); scanf("%d,%d", &m, &n); printf("%d행 %d열의 파스칼의 삼각형 숫자는 %d 입니다.\n",m, n, Pascal(m,n)); }