标签:bre range main lse import def continue port imp
from math import floor def panduan(num): if num > 1: if num > 1: # 查看因子 for i in range(2, num): if (num % i) == 0: return 0 break else: return 1 # 如果输入的数字小于或等于 1,不是质数 else: return 0 def main(): b = 600851475143 for i in range(2,floor(b/2)): a = panduan(i) if a == 1:#是质数 if (b % i) ==0: #能被质数整除 print(i) else: #不能被质数整除 continue else: #不是质数 continue main()
标签:bre range main lse import def continue port imp
原文地址:https://www.cnblogs.com/chif/p/9275419.html