CS61A Fall 2021 discussion 10 scheme相关——q1-q6
Q1: Virahanka-FibonacciWrite a function that returns the n-th Virahanka-Fibonacci number.(define (vir-fib n) (cond ((< n 2) n) (else (+ (vir-fib (- n 1)) (vir-fib (- n 2)))) ))(expect (vir-fib 2) 1)(expect (vir-fib 10) 55)
原创
2022-02-21 20:12:54 ·
478 阅读 ·
0 评论