第15451题 程序题
完善整数因式分解的Python程序代码

素数是只能被1和本身整除的正整数,因式分解就是将一个正整数分解成若干个素数相乘的形式。用户从键盘输入小于1000的整数,对其进行因式分解,例如:10=2*5,60=2*2*3*5。请完善下方程序代码:

#用户从键盘输入小于1000的整数,对其进行因式分解。例如:10=2*5,60=2*2*3*5。
x = input('Please input an integer less than 1000:')
x = int(x)
t = x
①  
result = []
while True:
    if t == 1:
        break
    if t % i == 0:
        result.  ②
        t = t/i
    else:
          ③
s=''for i in result:
    s=  ④
s=  ⑤
print( x,'=',s)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
编辑模式
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析