プログラミングのお題スレ Part5
■ このスレッドは過去ログ倉庫に格納されています
0358デフォルトの名無しさん
2014/10/21(火) 02:19:00.14ID:u6hR3S9i誤 (- (apply (quote max) x) (car x))
正 (- (apply (quote max) (cdr x)) (car x))
% cat example3.txt
10
9
7
4
0
% cat example3.txt | emacs -batch -Q --eval='(progn (require (quote cl-lib)) (let (l) (cl-loop (let ((x (ignore-errors (read)))) (if x (push x l) (cl-return))))
> (print (apply (quote max) (cl-mapcon (lambda (x) (when (cdr x) (list (- (apply (quote max) (cdr x)) (car x))))) (reverse l))))))' | sed 's/Lisp expression://g'
-1
■ このスレッドは過去ログ倉庫に格納されています