fork download
  1. (defun process-numeric-list ()
  2. ;; 数値リストを定義
  3. (let ((data-list '(150 420 300 250 380)))
  4. (format t "元のリスト: ~A~%" data-list)
  5.  
  6. ;; 降順にソート
  7. (let ((sorted-list (sort (copy-list data-list) #'>)))
  8. ;; 2番目に大きな要素を表示
  9. (format t "2番目の要素: ~A~%"
  10. (second sorted-list)))))
  11.  
  12. (process-numeric-list)
Success #stdin #stdout 0.01s 28948KB
stdin
Standard input is empty
stdout
元のリスト: (150 420 300 250 380)
2番目の要素: 380