Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Solving 20 using the big package

  • Loading branch information...
commit 8941026d91b9034bbabcda1c499f6b4d9fbba373 1 parent aa4a5d0
@coleifer authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 go/problem20.go
View
16 go/problem20.go
@@ -0,0 +1,16 @@
+package main
+
+import (
+ "fmt"
+ "math/big"
+)
+
+func main() {
+ n := new(big.Int)
+ n.MulRange(1, 100)
+ sum := 0
+ for _, d := range(n.String()) {
+ sum += int(d) - int('0')
+ }
+ fmt.Printf("%v\n", sum)
+}
Please sign in to comment.
Something went wrong with that request. Please try again.