fork(1) download
  1. def sum_digits(n):
  2. s = 0
  3. while n:
  4. s += n % 10
  5. n /= 10
  6. return s
  7. max = 0
  8. x = 0
  9. y = 0
  10. for i in range (1, 99):
  11. for j in range (1, 99):
  12. x = i**j
  13. y = sum_digits(x)
  14. if (y > max):
  15. max = y
  16. print max
Success #stdin #stdout 0.8s 7728KB
stdin
Standard input is empty
stdout
970