How to write a prolog program for recursive subtraction

后端 未结 0 1922
自闭症患者
自闭症患者 2021-01-25 01:03

I want a recursive subtraction program in prolog.

the scheme of the program is

(define (sub m n)
(cond
    ((= n 0) m)
    (else (sub (- m 1) (- n 1)))))
<         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题