Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; вырезать из списка знаки
- (defun chars(lst)
- (cond
- ((null lst) ())
- ((numberp (car lst)) (chars(cdr lst)))
- (T (cons(car lst) (chars (cdr lst))))
- )
- )
- ; вырезать из списка числа
- (defun numbers(lst)
- (cond
- ((null lst) ())
- ((numberp (car lst)) (cons(car lst) (numbers (cdr lst))))
- (T (numbers(cdr lst)))
- )
- )
- ; объеденение списков
- (defun mergelist(lst1 lst2)
- (cond
- ((null lst1) lst2)
- (T(cons (car lst1) (mergelist (cdr lst1) lst2)))
- )
- )
- ; основная функция
- (defun main(lst)
- (mergelist (chars lst) (numbers lst))
- )
- (setq ARR '(30 * 2 - 5 + 88 - 77))
- (terpri)
- (write-string "INPUT:")
- (write ARR)
- (terpri)
- (write-string "OUT:")
- (write (main ARR))
- (terpri)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement