AI题库 · GESP-Python五级题库
题目分享 #18169
下面程序是对n!进行唯一分解,横线处应该填入的是( )。
def unique_fac(n):
print(n, '=', end='')
for i in range(2, n + 1):
_____________________________
print(' {}*'.format(i), end='')
n //= i
if n % i == 0 and i == n:
print(' {}'.format(i), end='')
break
unique_fac(math.factorial(5))
A
while n % i != 0 and i != n:
B
while n % i == 0 and i == n:
C
while n % i == 0 and i != n:
D
while n % i != 0 and i == n:
AI题库 · 编程考级与信奥赛真题库
查看答案 →
复制链接后可在微信、QQ、小红书等平台粘贴分享;答案与解析在题目页。