diff options
-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] + |
index : nlp_scripts | ||
Mirror of https://github.com/pks/nlp_scripts.git |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | median | 14 |
@@ -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] + |