利用二进制和位运算的方式快速求幂 1234567 def (a, b): res, base = 1, b while b != 0: if b&1 == 1: res *= base base *= base b >>= 1 return res 赞微海报分享
近期评论