[ create a new paste ] login | about

Link: http://codepad.org/iqjwda6T    [ raw code | output | fork ]

Python, pasted on Mar 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
max = 0
for a in range(1, 100):
	for b in range(1, 100):
		num = a ** b
		tmp = num
		sum = 0
		while tmp > 0:
			sum = sum + tmp % 10
			tmp = tmp // 10
		if max < sum:
			max = sum

print(max)


Output:
1
972


Create a new paste based on this one


Comments: