Created
April 19, 2014 14:44
-
-
Save apeiros/11086444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
# grab the input, convert it, sum it, and spit out the answer | |
$stdin.each_line do |line| | |
puts line.scan(/\d+/).map(&:to_i).reduce(:+) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment