Euler第三题

帮同学做道题....其实真没什么好的做法....

 

 1 def getList(n):
 2     result = []
 3     count = 3
 4     max = n
 5     while max%2 == 0:
 6         max /= 2
 7         result.append(2)
 8     
 9     while count <= max:
10         if max%count == 0:
11             result.append(count)
12             max /= count
13         else:
14             count += 2
15     return result
16 

17 print getList(600851475143) 

posted @ 2011-07-31 23:55 飞林沙 阅读(136) 评论(0) 编辑 收藏
发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 2123308 DSGob7Nfz4o=