按照题目要求编写的完整的Python程序如下
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import math
def IsPrime(n):
#**********Program*******
flag=True
for i in range(2,int(math.sqrt(n))+1):
if n%i==0 :
flag=False
break
return flag
#**********end**********
def demo(n):
if n>0 and n%2==0 :
for i in range(3,int(n/2)+1):
if i%2==1 and IsPrime(i) and IsPrime(n-i) :
print(n,'=',i,'+',n-i)
def main():
a=int(input("【请输入一个正偶数】"))
demo(a)
if __name__ == '__main__':
main()