Skip to content

Commit f3f8fe9

Browse files
committed
16
1 parent c7ff0b3 commit f3f8fe9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

16.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"math/big"
6+
"strconv"
7+
"strings"
8+
)
9+
10+
func main() {
11+
biggie := new(big.Int)
12+
base := new(big.Int)
13+
pow := new(big.Int)
14+
biggie.Exp(base.SetInt64(2), pow.SetInt64(1000), nil)
15+
digits := strings.Split(biggie.String(), "")
16+
sum := 0
17+
for _, s := range digits {
18+
v, _ := strconv.Atoi(s)
19+
sum += v
20+
}
21+
fmt.Println(sum)
22+
}

0 commit comments

Comments
 (0)