Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Created August 12, 2011 19:54
Show Gist options
  • Save aalvesjr/1142851 to your computer and use it in GitHub Desktop.
Save aalvesjr/1142851 to your computer and use it in GitHub Desktop.
Izabela e os numeros
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