63: powerful digit counts

This commit is contained in:
VicRen
2020-12-19 21:45:13 +08:00
parent d583fadd1d
commit e485274ac2

View File

@@ -0,0 +1,22 @@
package main
import (
"fmt"
"math"
)
func main() {
c := 0.
for n := 1.; n <= 9.; n++ {
c += math.Floor(math.Ln10 / math.Log(10/n))
}
fmt.Println("solution=", c)
}
func nPower(n, num int) int64 {
p := int64(1)
for i := 0; i < n; i++ {
p *= int64(num)
}
return p
}