summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmedian14
1 files changed, 14 insertions, 0 deletions
diff --git a/median b/median
new file mode 100755
index 0000000..3797164
--- /dev/null
+++ b/median
@@ -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]
+