Skip to content

Instantly share code, notes, and snippets.

@ushu
Created October 16, 2014 16:04
Show Gist options
  • Save ushu/09df5db872e569ccd462 to your computer and use it in GitHub Desktop.
Save ushu/09df5db872e569ccd462 to your computer and use it in GitHub Desktop.
A dumb program that sums its input
input = STDIN.read.split("\n")
input.shift # skip first line
puts input.map { |x| Integer(x) }.inject(&:+)
4
1
2
3
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment