Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Starting problems with go

  • Loading branch information...
commit 3c43f84bde1012645f0efdf403cb5469346fee56 1 parent 6e42752
Charles Leifer authored April 20, 2012

Showing 1 changed file with 17 additions and 0 deletions. Show diff stats Hide diff stats

  1. 17  go/problem01.go
17  go/problem01.go
... ...
@@ -0,0 +1,17 @@
  1
+package main
  2
+
  3
+import "fmt"
  4
+
  5
+func is_fizzbuzz(i int) bool {
  6
+    return i % 5 == 0 || i % 3 == 0;
  7
+}
  8
+
  9
+func main() {
  10
+    s := 0
  11
+    for i := 0; i < 1000; i++ {
  12
+        if is_fizzbuzz(i) {
  13
+            s += i
  14
+        }
  15
+    }
  16
+    fmt.Printf("Sum: %v\n", s)
  17
+}

0 notes on commit 3c43f84

Please sign in to comment.
Something went wrong with that request. Please try again.