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

 

 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) 

相关文章:

  • 2022-01-04
  • 2021-11-28
  • 2021-06-07
  • 2022-12-23
  • 2021-11-20
  • 2021-05-07
  • 2021-04-10
  • 2021-06-30
猜你喜欢
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-12-19
  • 2021-07-20
  • 2021-11-05
相关资源
相似解决方案