Skip to content

Instantly share code, notes, and snippets.

@ozw-sei
Created June 11, 2013 10:36
Show Gist options
  • Select an option

  • Save ozw-sei/5755936 to your computer and use it in GitHub Desktop.

Select an option

Save ozw-sei/5755936 to your computer and use it in GitHub Desktop.
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