-
-
Save daniel-g/523745 to your computer and use it in GitHub Desktop.
This file contains 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
#Feedback from "El gran pregunton" !!!! | |
c = 0 | |
d = 0 | |
5001.times do | |
c += 1 | |
d = d + c | |
end | |
put "the value number is: #{d}" | |
# Al parecer no quedo muy claro el problema | |
# ya que el valor de "d" es el numero triangular correspondiente a 5000 | |
# Por otro lado es posible refactorizar tu codigo de la siguiente manera | |
d = 0 | |
5001.times do |c| | |
d += c | |
end | |
put "the value number is: #{d}" | |
# Si tuvieses alguna duda, no dudes en preguntar a cualquier miembro del comité | |
# Saludos | |
# Por cierto ... nos debes una caguama y unas Chips Verdes =P | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment