Skip to content

Instantly share code, notes, and snippets.

@yswallow
Created April 28, 2013 02:28
Show Gist options
  • Select an option

  • Save yswallow/5475616 to your computer and use it in GitHub Desktop.

Select an option

Save yswallow/5475616 to your computer and use it in GitHub Desktop.
(ry)
for i in 1...250
sum = 0
t = i
while sum<500
sum += t
if sum==500
puts i
break
end
t += 1
end
end
#=> 8,59,98
@yswallow
Copy link
Copy Markdown
Author

C言語で書いた後だからendに対応する決まったものがないRubyが気持ち悪い

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