shu =int(input("一个正整数:"))
s=[]
for i in range(2,int((shu+2)/2)):
a =True
while a ==True:
if shu % i ==0:
s.append(str(i))
shu = shu/i
else:
a=False
print("*".join(s))
shu =int(input("一个正整数:"))
s=[]
for i in range(2,int((shu+2)/2)):
a =True
while a ==True:
if shu % i ==0:
s.append(str(i))
shu = shu/i
else:
a=False
print("*".join(s))
本文标题:将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*
本文链接:https://www.haomeiwen.com/subject/vnahlftx.html
网友评论