Created
September 17, 2012 09:12
-
-
Save masahixixi/3736362 to your computer and use it in GitHub Desktop.
ProjectEuler #6
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
sum = 0 | |
prod1 = 0 | |
prod2 = 0 | |
(1..100).each do |num| | |
prod1 += num ** 2 | |
sum += num | |
end | |
prod2 = sum ** 2 | |
p prod2 - prod1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
変数名が(略