Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Lisp by knst ( 15 years ago )
Лаба 2:
(define cilinder (lambda (x y z)
(cons (sqrt (+ (* x x) (* y y)))
(cons (atan (/ x y)) (cons z '())))
)
)
Вызов:
> (cilinder 1 1 2)
(1.4142135623730951 0.7853981633974483 2)
Лаба 4:
(define sum (lambda (x) (cdr x)))
(define sum2 (lambda (x)
(if (null? (cdr x))
'()
(cons (+ (car x) (car (cdr x)))
(sum2 (cdr x)))
)
)
)
Вызов:
> (sum2 '(1 2 3 5))
(3 5 8)
Revise this Paste
Parent: 40038