题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
一直没弄明白这个质数因子的算法 主要是对这个概念没弄明白 代码先贴上,还得再研究研究
num = int(input())
for i in range(2, round(num**0.5)+1):
while num % i ==0:
print(i, end=" ")
num = num//i
if num!=1:
print(num, end=" ")
for i in range(2, round(num**0.5)+1):
while num % i ==0:
print(i, end=" ")
num = num//i
if num!=1:
print(num, end=" ")