def isZhiShu(num):
temp = num-1
if num == 2:
return True
else:
while num % temp != 0:
temp -= 1
if temp == 1:
return True
else:
return False
s = int(input())
product = 0
num = 2
while num <= s-num:
if isZhiShu(num) and isZhiShu(s-num):
if num*(s-num) > product:
product = num*(s-num)
num += 1
print(product)
XD python oj 1017质数的和与积
最新推荐文章于 2024-05-14 11:00:23 发布