Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 21 lines (18 sloc) 0.311 kb
7e74f6e @thezerobit initial commit
authored
1 # too easy with Python
2 def sumdp(a,b):
3 pw = a ** b
4 sum = 0
5 for digit in str(pw):
6 sum += int(digit)
7 return sum
8
9 maxsum = 0
10 maxa = 0
11 maxb = 0
12
13 for a in xrange(1,100):
14 for b in xrange(1,100):
15 sdp = sumdp(a,b)
16 if sdp > maxsum:
17 maxsum = sdp
18 maxa = a
19 maxb = b
20
21 print a,b,maxsum
Something went wrong with that request. Please try again.