projecteuler---->problem=16----Power digit sum

来源:互联网 发布:淘宝咸鱼官方下载 编辑:程序博客网 时间:2024/05/01 00:04

215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

What is the sum of the digits of the number 21000?

翻译:

215 = 32768的各位数之和为3 + 2 + 7 + 6 + 8 = 26。

那么21000的各位数之和为……?

import mathm=pow(2,1000)s=0while m>0:    s+= m%10    m /= 10print s


0 0
原创粉丝点击