summaryrefslogtreecommitdiff
path: root/sum
diff options
context:
space:
mode:
Diffstat (limited to 'sum')
-rwxr-xr-xsum8
1 files changed, 8 insertions, 0 deletions
diff --git a/sum b/sum
new file mode 100755
index 0000000..3fca95e
--- /dev/null
+++ b/sum
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+
+sum = 0.0
+while line = STDIN.gets
+ sum += line.strip.to_f
+end
+puts sum
+