Created
April 28, 2013 02:28
-
-
Save yswallow/5475616 to your computer and use it in GitHub Desktop.
(ry)
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
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
C言語で書いた後だからendに対応する決まったものがないRubyが気持ち悪い