
实现上述功能的程序如下,请在程序划线处填入合适的代码。
import math
n=int(input('请输入一个大于2的偶数:'))
p=1
flagp=flagq=False
while flagp==False or flagq==False:
p+=1
if p>n/2:
flagp=True
for j in range(2,int(math.sqrt(p)+1)):
if p%j==0:
flagp=False
flagq=True
for j in range(2,int(math.sqrt(q)+1)):
if q%j==0:
flagq=False
if
print(str(n),'=',str(p),'+',str(q))
else:
print('Failed!')

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

