接著再扣掉全部小於1000的15的倍數即可得解。
[Ruby]
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
answer = 0 | |
3.step(999,3){ |i| answer += i } | |
5.step(999,5){ |j| answer += j } | |
15.step(999,15){ |k| answer -= k } | |
p answer |
0 意見:
張貼留言