Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- (define (invfact x i)
- (define y (/ x i))
- (cond
- [(= y 1) x]
- [(> y 1) (invfact y (+ i 1))]
- [(< y 1) (error "Aucune factorielle possible")]))
- (define (display_invfact n)
- (printf "~a = ~a!\n" n (invfact n 2)))
- (display_invfact 120)
- (display_invfact 3628800)
- (display_invfact 479001600)
- (display_invfact 6)
- (display_invfact 18)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement