Created
October 22, 2014 15:04
-
-
Save hayamiz/af76fd6ed3bc9cc86578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//usr/bin/env go run $0 $@ ; exit | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
var sum = 0 | |
for i := 0; i < 1000; i++ { | |
if i % 3 == 0 || i % 5 == 0 { | |
sum += i | |
} | |
} | |
fmt.Printf("%d\n", sum) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment