def fun(num):
sum = 1
if num > 1:
sum = num * (num - 1)
num = num - 1
sum = sum * ( num - 1 )
fun(num-1)
return sum
while True:
num = input('输入一个数>>').strip()
if num.isdigit():
res = fun(int(num))
print(res)
breakelse:
print('请重新输入')
posted on
2019-01-21 15:02小胖子方法
阅读(181)
评论(0)
编辑收藏举报