DrRacket - Display all the values in a list that are above average
问题 I'm creating a function that consumes a list of numbers and produces the elements in the list that are above average. Below is my code: (define (listlength list) (cond ((empty? list) 0) (else (+ 1 (listlength (rest list)))))) (define (listsum list) (cond [(empty? list) 0] [else (+ (first list) (listsum (rest list)))])) (define (average log) (/ (listsum log) (+ (listlength log) 1))) (define (average-filter log) (cons (cond [(> (first log) (average log)) (first log)] [else (average-filter (rest