2013-04-17 14:34:39 +08:00

16 lines
237 B
Python

def numsum(x):
out = 0
while x > 0:
out += x % 10
x /= 10
return out
mmax = [0, 0, 0]
for i in xrange(1, 101):
for j in xrange(1, 101):
tmp = numsum(i ** j)
if tmp > mmax[0]:
mmax = [tmp, i, j]
print mmax