-
-
Save daclouds/a5678aa4a0bd41aff07d to your computer and use it in GitHub Desktop.
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
/* | |
* 10보다 작은 자연수 중에서 3 또는 5의 배수는 3, 5, 6, 9 이고, 이것을 모두 더하면 23입니다. | |
* 1000보다 작은 자연수 중에서 3 또는 5의 배수를 모두 더하면 얼마일까요? | |
*/ | |
object Euler01 extends App { | |
println(List.range(1, 1000).filter(x => x % 3 == 0 || x % 5 == 0).sum) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment