_____________________________________________
(defun lista (a b c d e)
(setq li (list a b c d e))
(setq suma 0)
(setq i 0)
(while (< i 5)
(setq val (nth i li)
)
(setq i (+ i 1))
(setq suma(+ suma val))
)
____________________________________________
(defun sumal (a b c d e f)
(setq suma 0)
(setq i 0)
(setq lista (list a b c d e f))
(while (< i 6)
(setq valor (nth i lista))
(setq i (+ i 1))
(setq suma (+ suma valor))
))
(sumal 1 2 3 4 5 6)
;lista vacia (list)
;(setq resul suma)
No hay comentarios:
Publicar un comentario