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