质数是指一个大于1的自然整数中,除了1和本身外,没法被其他自然数整除的数,分享一段列出质数的Python代码。
i = 2
while (i < 100):
j = 2
while (j <=(i/j)):
if not (i%j):break
j1 = j + 1
if (j>i/j):
print (i, "是质数")
i = i + 1
print ("统计完毕,Good bye!")
» 本文链接地址:https://blog.mydns.vip/2597.html
豫章小站














最新评论