首页 > 编程语言 > 详细

Euler Project question 48 in python way

时间:2014-10-19 21:21:58      阅读:313      评论:0      收藏:0      [点我收藏+]

# The series, 11 + 22 + 33 + ... + 1010 = 10405071317.

# Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.

import time
start = time.time()
print "last ten digits was %s and cost %s seconds" % (str(sum([i**i for i in range(1, 1001)]))[-10:], time.time() - start)

Euler Project question 48 in python way

原文:http://www.cnblogs.com/cyberpaz/p/4035434.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!