# whilefact.py
n = input('Enter an integer >= 0:')
fact = 1
i = 2
while i <= n:
fact = fact * i
i = i + 1
print(str(n)+'factorial is' + str(fact))
*while计算阶乘
最新推荐文章于 2025-01-03 15:12:27 发布
# whilefact.py
n = input('Enter an integer >= 0:')
fact = 1
i = 2
while i <= n:
fact = fact * i
i = i + 1
print(str(n)+'factorial is' + str(fact))
2021

被折叠的 条评论
为什么被折叠?