Or even better:

----
input = STDIN.readlines.collect {|x| x.to_f}

average = input.inject(0) {|m,x| m = m+x} / input.size
count = input.count {|x| x > average}

print "Average = #{average}\n"
print "Number of elements greater than Avg = #{count}\n"
----