# 用for循环计算 n!
sum =
n=int(input('请输入n='))
for i in range(,n+):
for j in range(i,,-):
sum *= j # sum=sum*j
print('%d!=%3d' %(i,sum))
sum=
2024-04-08 14:11:46
# 用for循环计算 n!
sum =
n=int(input('请输入n='))
for i in range(,n+):
for j in range(i,,-):
sum *= j # sum=sum*j
print('%d!=%3d' %(i,sum))
sum=