Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Solving 20 using the big package

  • Loading branch information...
commit 8941026d91b9034bbabcda1c499f6b4d9fbba373 1 parent aa4a5d0
Charles Leifer authored April 26, 2012

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

  1. 16  go/problem20.go
16  go/problem20.go
... ...
@@ -0,0 +1,16 @@
  1
+package main
  2
+
  3
+import (
  4
+    "fmt"
  5
+    "math/big"
  6
+)
  7
+
  8
+func main() {
  9
+    n := new(big.Int)
  10
+    n.MulRange(1, 100)
  11
+    sum := 0
  12
+    for _, d := range(n.String()) {
  13
+        sum += int(d) - int('0')
  14
+    }
  15
+    fmt.Printf("%v\n", sum)
  16
+}

0 notes on commit 8941026

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