Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int pascal(int n, int k);
- void main(){
- int n, k;
- scanf("%d %d", &n, &k);
- printf("%d\n", pascal(n, k));
- }
- int pascal(int n, int k){
- if (k == 0 || k == n)
- return 1;
- return (pascal(n - 1, k - 1) + pascal(n - 1, k));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement