Python题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
import math
num = int(input())
if num == 1:
print(1)
else:
prime = 2
while prime <= math.sqrt(num):
while num % prime == 0:
num //= prime
print(prime, end=' ')
prime += 1 if prime == 2 else 2
if num > 1:
print(int(num), end=' ')
