Skip to content

Instantly share code, notes, and snippets.

@kazua
Created November 26, 2012 11:32
Show Gist options
  • Save kazua/4147764 to your computer and use it in GitHub Desktop.
Save kazua/4147764 to your computer and use it in GitHub Desktop.
Project Euler Problem 01
//http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%201
//K.A
object problem01 {
def getMtp(mn : Int) : Int = {
Range(1, mn).toList.filter(i => i % 3 == 0 || i % 5 == 0).sum
}
def main(args : Array[String]) {
val mn = 1000
println(getMtp(mn))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment