标签:阶乘 递归 input 5* pre return put number ==
def recurursion(n):
if n == 1:
return 1
else:
return n * recurursion(n-1)
number = int(input("请输入一个整数:"))
b = recurursion(number)
print("%d的乘阶是:%d" % (number,b))
分析:
return 5*recurursion(4)
return 4*recurursion(3)
return 3*recurursion(2)
return 2*recurursion(1)
(n=1) return 1
标签:阶乘 递归 input 5* pre return put number ==
原文地址:https://www.cnblogs.com/heguoze/p/9225828.html