题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
def factor(N):
res=[]
if N>1:
c=int(N**0.5)
while N%c:
c=c-1
if c==1:
res.append(int(N)) #int !!!!!
else:
res=res+factor(c)
res=res+factor(N/c)
return res
if __name__=="__main__":
N=int(input())
res=factor(N)
str_res=list(map(str,sorted(res)))
s=' '.join(str_res)
print(s)
传音控股公司福利 325人发布