Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (add n x)
- (cond
- [(and
- (number? n)
- (number? x))
- (cond
- [(zero? x) n]
- [else (add (add1 n) (sub1 x))])]
- [else (error 'either_n_or_x_not_a_number)]))
- (define (multiply n x)
- (cond
- [(and
- (number? n)
- (number? x))
- (cond
- [(zero? n) 0]
- [else (add x (multiply (sub1 n) x))])]
- [else (error 'either_n_or_x_not_a_number)]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement