[ create a new paste ] login | about

Link: http://codepad.org/TU5segMo    [ raw code | output | fork ]

Scheme, pasted on Apr 5:
1
2
3
4
5
6
7
8
(define C 
  (lambda (n k)
    (if (eq? k 0) 1
        (if (eq? n k) 1
            (+ (C (- n 1) (- k 1))
               (C (- n 1) k))))))

(display (C 5 2))


Output:
1
10


Create a new paste based on this one


Comments: