Skip to content

Instantly share code, notes, and snippets.

@kyupark
Last active January 27, 2019 13:42
Show Gist options
  • Save kyupark/1377153 to your computer and use it in GitHub Desktop.
Save kyupark/1377153 to your computer and use it in GitHub Desktop.
(define (fibo n)
(cond
((= n 0) 1)
((= n 1) 1)
(true (+ (fibo (- n 1)) (fibo (- n 2))))
)
)
(define (sumofint n)
(cond
((= n 0) 0)
(true (+ (sumofint (- n 1)) n))
)
)
@oxbambooxo
Copy link

(define (fibo n)
  (cond
    ((= n 0) 0)
    ((= n 1) 1)
    (true (+ (fibo (- n 1)) (fibo (- n 2))))
    )
  )

(fibo 0) wanna 0, describe in https://en.wikipedia.org/wiki/Fibonacci_number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment