Created
August 12, 2011 19:54
-
-
Save aalvesjr/1142851 to your computer and use it in GitHub Desktop.
Izabela e os numeros
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
var = 0 | |
# Inicia em 14614 e vai até 26601 | |
(14614..26601).each do |n| | |
# Incrementa se incluir o numero 6 e NÃO incluir o 1 | |
var += 1 if "#{n}".include? "6" and !"#{n}".include? "1" | |
end | |
puts var | |
# => 1491 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment