(define (iskadomatz? a b c) (and (not (= a c)) (or (and (< a b) (> b c)) (and (> a b) (< b c)))) ) ; 2時間ぐらいググったけれど展開方法が分からなかったので気合 (define (iskadomatz2? arr a b) (iskadomatz? a b (car arr)) ) (define (iskadomatz1? arr a) (iskadomatz2? (cdr arr) a (car arr)) ) (define (iskadomatz-list? arr) (iskadomatz1? (cdr arr) (car arr)) ) (define (replace arr from to) (map (lambda (e) (if (equal? e from) to e)) arr) ) (let ( (bamboo (list (read) (read) (read))) ) (if (iskadomatz-list? (replace bamboo '? 1)) (write 1) #f) (if (iskadomatz-list? (replace bamboo '? 4)) (write 4) #f) )