Skip to content

Instantly share code, notes, and snippets.

@Geresis
Created April 13, 2016 15:09
Show Gist options
  • Save Geresis/8d4e9eb9fba8add5c37bd87e0d4914b7 to your computer and use it in GitHub Desktop.
Save Geresis/8d4e9eb9fba8add5c37bd87e0d4914b7 to your computer and use it in GitHub Desktop.
total = 0
f = File.open("numbers.txt", "r")
f.each_line do |linea|
linea.each_char do |numero|
total += numero.to_i
end
end
puts "La suma es = #{total}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment