发布网友 发布时间:2022-04-28 10:33
共1个回答
热心网友 时间:2022-04-19 01:00
num = int(input("请输入一个数字: "))
if num > 1:
for i in range(2,num):
if (num % i) == 0:
print(num,"不是质数")
print(i,"乘于",num//i,"是",num)
break
else:
print(num,"是质数")
else:
print(num,"不是质数")