Skip to content

Instantly share code, notes, and snippets.

@JustinAiken
Created May 17, 2012 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinAiken/2721399 to your computer and use it in GitHub Desktop.
Save JustinAiken/2721399 to your computer and use it in GitHub Desktop.
euler 1
def problem001
total = 0
for i in 1..9
if i%3 == 0
puts "#{i} is divisible by 3"
total = total + i
puts total
end
if i%5 == 0
puts "#{i} is divisible by 5"
total = total + i
puts total
end
end
return total
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment