Skip to content

Instantly share code, notes, and snippets.

@ccw
Created March 26, 2012 03:29
Show Gist options
  • Save ccw/2202657 to your computer and use it in GitHub Desktop.
Save ccw/2202657 to your computer and use it in GitHub Desktop.
[Project Euler in Groovy] - P1
final def MAX = 1000
def sum = 0
(3..MAX-1).each {
if (it % 3 == 0 || it % 5 == 0) {
sum += it
}
}
println "sum => $sum"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment