projecteuler 16.Power digit sum
打了个表看了看,好像没什么算法能搞出来啊
直接python吧(
num = 2 ** 1000
res = 0
while num != 0:
res = res + num % 10
num //= 10
print(res)
𝓐𝓬𝓱𝓲𝓮𝓿𝓮𝓶𝓮𝓷𝓽 𝓹𝓻𝓸𝓿𝓲𝓭𝓮𝓼 𝓽𝓱𝓮 𝓸𝓷𝓵𝔂 𝓻𝓮𝓪𝓵
𝓹𝓵𝓮𝓪𝓼𝓾𝓻𝓮 𝓲𝓷 𝓵𝓲𝓯𝓮
打了个表看了看,好像没什么算法能搞出来啊
直接python吧(
num = 2 ** 1000
res = 0
while num != 0:
res = res + num % 10
num //= 10
print(res)