Skip to content

Instantly share code, notes, and snippets.

@pcg79
Created November 21, 2013 14:55
Show Gist options
  • Save pcg79/7582980 to your computer and use it in GitHub Desktop.
Save pcg79/7582980 to your computer and use it in GitHub Desktop.
Project Euler #1
sum = 0
1000.times do |x|
sum += x if x % 3 == 0 || x % 5 == 0
end
puts sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment