计算排列数

 

(defun permutation-count (n c)
    (let ((ans 1))
        (loop for i from (- n (1- c)) upto n do (setf ans (* ans i))) ans))


(format t "~D~%" (permutation-count 6 5))
Author: ismdeep
License: Copyright (c) 2021 CC-BY-NC-4.0 LICENSE