我真是太喜欢用join了
import math
num = int(input())
sq = math.sqrt(num)
NumberArray=[]
for i in range(2,int(sq+1)):
try:
while num%i==0:
NumberArray.append(str(i))
num=int(num/i) #就是这里忘记int,害的第一次提交没全部通过
except:
break
if num>1:
NumberArray.append(str(num))
print(' '.join(NumberArray))