New life from now
02 July, 2010
算法之美:求一个数n的最大质因数(Python)
n=600851475143
d=2
while d < n/d:
if n%d==0:
n/=d
else:
d+=1
print n
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment