Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Starting problems with go

  • Loading branch information...
commit 3c43f84bde1012645f0efdf403cb5469346fee56 1 parent 6e42752
@coleifer authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 go/problem01.go
View
17 go/problem01.go
@@ -0,0 +1,17 @@
+package main
+
+import "fmt"
+
+func is_fizzbuzz(i int) bool {
+ return i % 5 == 0 || i % 3 == 0;
+}
+
+func main() {
+ s := 0
+ for i := 0; i < 1000; i++ {
+ if is_fizzbuzz(i) {
+ s += i
+ }
+ }
+ fmt.Printf("Sum: %v\n", s)
+}
Please sign in to comment.
Something went wrong with that request. Please try again.