输入一个整数N(512 <= N <= 1024)
2的N次方的十进制结果
512
13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096
print(2 ** int(input()))
使用math/big库
package main
import (
"fmt"
"math/big"
)
func main() {
var (
input int64
i *big.Int
n *big.Int
)
i = big.NewInt(2)
fmt.Scan(&input)
n = big.NewInt(input) // 将输入的int64格式整数转为bigint类型
i.Exp(i, n, nil) // 计算i的n次幂
fmt.Println(i)
}