diff options
author | Patrick Simianer <p@simianer.de> | 2014-03-07 17:54:24 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-03-07 17:54:24 +0100 |
commit | ffe67192a0d67207c97a3424c0c89e805f28e651 (patch) | |
tree | f3ddd5be4bd71ad753a32ee663b6d4b352e4ec80 | |
parent | e7281b5c337f9684dc40c809262afc9359b0c771 (diff) |
median
-rwxr-xr-x | median | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require 'nlp_ruby' + + +a = [] +while line = STDIN.gets + a << line.to_f +end + +a.sort! + +puts a[a.size/2] + |