Skip to content

Instantly share code, notes, and snippets.

@masahixixi
Created September 17, 2012 09:12
Show Gist options
  • Save masahixixi/3736362 to your computer and use it in GitHub Desktop.
Save masahixixi/3736362 to your computer and use it in GitHub Desktop.
ProjectEuler #6
sum = 0
prod1 = 0
prod2 = 0
(1..100).each do |num|
prod1 += num ** 2
sum += num
end
prod2 = sum ** 2
p prod2 - prod1
@yujinakayama
Copy link

変数名が(略

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment