Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun modul(a)
- (if (< a 0) (- a) a))
- (defun neg(a)
- (if (< a 0) (- a) (- a)))
- (defun mij(a b c)
- (cond ((and (= (min a b c) a) (= (max a b c) c)) b)))
- (defun my-third(lista)
- (if (listp lista) (nth '2 lista) NIL))
- (defun my-last(lista)
- (if (listp lista) (last lista) NIL))
- (defun my-append(x y)
- (if (and (listp x) (listp y)) (append x y) NIL))
- (defun palindrom(lista)
- (if (equal (reverse lista) lista) T NIL))
- (defun eq(a b c)
- (let ((d (- (* b b) (* 4 a c))))
- (if (> d 0) (list (/ (+ (- b) d) (* 2 a)) (/ (- (- b) d) (* 2 a))) "Solutii complexe")))
- (defun fu(x)
- (cond ((< x -2) (* x x)) ((= x -2) (* x x)) ((< x 1) (+ x 2)) ((= x 1) (+ x 2)) ((> x 1) (sqrt (+ (* x x) 1))) ))
- (defun fnc(a lista)
- (if (member a lista) (member a lista) (append lista (list a))))
- (defun meniu()
- (format t "1 - Adunare\n")
- (format t "2 - Scadere\n")
- (format t "3 - Inmultire\n")
- (format t "4 - Restul impartirii\n")
- (format t "Alegeti optiunea, apoi introduceti doua numere: ")
- (let ( (opt (read)) (x (read)) (y (read)) )
- (cond ((= opt 1) (+ x y)) ((= opt 2) (- x y)) ((= opt 3) (* x y)) ((= opt 4) (rem x y)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement