题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
const rl = require("readline").createInterface({ input: process.stdin,
output:process.stdout});
let res=[]
const test=(n)=>{
for(let i=2;i<n;i++){
if(n%i===0){
res.push(i)
if((n/i)!==1){
test(n/i)
}
break
}else{
if((n/i)<3){
res.push(n)
break
}
}
}
}
rl.on('line',(line)=>{
test(line)
res.sort((a,b)=>{
return a-b})
console.log(res.join(' '))
})