Skip to content

Instantly share code, notes, and snippets.

@miracle0k
Created April 17, 2013 22:24
Show Gist options
  • Save miracle0k/da7bc27a8034f973561d to your computer and use it in GitHub Desktop.
Save miracle0k/da7bc27a8034f973561d to your computer and use it in GitHub Desktop.
object p01 {
var sum = 0; //> sum : Int = 0
for ( i <- 1 to 1000) {
if (i % 3 == 0 || i % 5 == 0) {
sum += i
}
}
println(sum) //> 234168
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment