Функції рядків
Відповіді
1. (DEFUN appl (lst1 lst2)
((NULL lst1) (append lst3 lst2))
((NULL lst2) (append lst3 lst1))
((STRING< (CAR lst1) (CAR lst2)) (CONS (CAR lst1) (appl (CDR lst1) lst2)))
(CONS (CAR lst2) (APPL lst1 (CDR lst2))) )
(DEFUN QSORT (lst)
((NULL (CDR lst)) lst)
((NULL (CDDR lst))
((STRING< (CAR lst) (CADR lst)) lst)
(CONS (CADR lst) (CONS (CAR lst) NIL)))
(SETQ tmp1 (SPLIT lst))
(APPL (QSORT tmp1) (QSORT lst)) )
(DEFUN srt (in out)
(OPEN-INPUT-FILE in)
(OPEN-OUTPUT-FILE out)
(SETQ temp NIL)
(LOOP
((NOT (LISTEN)))
(PUSH (READ) temp) )
(setq temp1 (qsort temp))
(print temp1)
(CLOSE-INPUT-FILE in)
(CLOSE-OUTPUT-FILE out) )
2. (DEFUN prnum2 (num)