标签:style blog color div sp 代码 log c ef
求第10001个质数(用这个代码,我的笔记本大概算了40s):
count=1 num=3 def findPrime(s): i=2 a=s while i<s/2: if s%i == 0: s=s/i break else: i=i+1 if s==a: return True else: return False while count <10001: if findPrime(num): count =count + 1 num = num +2 else: num = num+2 print num-2
标签:style blog color div sp 代码 log c ef
原文地址:http://www.cnblogs.com/fei-hsueh/p/3970403.html