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