Skip to content

Commit

Permalink
sumlines: sum numeric input
Browse files Browse the repository at this point in the history
  • Loading branch information
robmiller committed Mar 20, 2022
1 parent ac3ab6e commit 3a9a865
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/sumlines
@@ -0,0 +1,3 @@
#!/usr/bin/env ruby

puts ARGF.each_line.map { |l| l.to_i }.reduce(&:+)

0 comments on commit 3a9a865

Please sign in to comment.