Skip to content

Instantly share code, notes, and snippets.

@hayamiz
Created October 22, 2014 15:06
Show Gist options
  • Save hayamiz/84bcf8b1f190b3f9852e to your computer and use it in GitHub Desktop.
Save hayamiz/84bcf8b1f190b3f9852e to your computer and use it in GitHub Desktop.
//usr/bin/env go run $0 $@ ; exit
package main
import (
"fmt"
)
func main() {
sum := 0
for n, m := 1, 2; n < 4000000; n, m = m, n + m {
if n % 2 == 0 {
sum += n
}
}
fmt.Println(sum)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment