Created
May 4, 2014 21:14
-
-
Save jamesmichiemo/d03464293e9d3728edc6 to your computer and use it in GitHub Desktop.
Project Euler: problem 1 http://projecteuler.net/problem=1
This file contains hidden or 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
| sum = 0 | |
| (0...1000).each do |i| | |
| sum += i if (i%3 == 0 || i%5 == 0) | |
| end | |
| puts "The sum total of all the multiples of 3 or 5 is #{sum}." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment