-
-
Save ozw-sei/5755936 to your computer and use it in GitHub Desktop.
ProjectEuler1 ref: http://qiita.com/items/1af84359e86a5d3ce9a1
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
| object Euler1 { | |
| def fizz(num:Int) = num % 3 == 0 | |
| def buzz(num:Int) = num % 5 == 0 | |
| def main(args: Array[String]): Unit = { | |
| val list = for{ i <- 1 to 999 if(fizz(i) || buzz(i))} yield i | |
| println(list.sum) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment