Skip to content

Instantly share code, notes, and snippets.

@danny8376
Last active August 29, 2015 14:10
Show Gist options
  • Save danny8376/75bc7d84dd9673650c4d to your computer and use it in GitHub Desktop.
Save danny8376/75bc7d84dd9673650c4d to your computer and use it in GitHub Desktop.
# 自分の得意な言語で
# Let's チャレンジ!!
# Normal way
=begin
sum = 0
# first input is the count of lines
gets.to_i.times do
sum += gets.to_i
end
puts sum
=end
# Rubyは怖いです
puts gets.to_i.times.map{gets.to_i}.inject(&:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment