Skip to content

Instantly share code, notes, and snippets.

@snuxoll
Created April 10, 2009 15:26
Show Gist options
  • Save snuxoll/93128 to your computer and use it in GitHub Desktop.
Save snuxoll/93128 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
total = 0
STDIN.each_line do |line|
total += line.split(" ").inject(0) { |sum, x| sum + x.to_i }
end
puts "GRAND TOTAL: #{total}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment