Commit 5cdc9b97 by BellCodeEditor

auto save

parent 81aa8207
Showing with 13 additions and 0 deletions
#数列之积n*(n-1)*(n-2)*.......*1
def faction(n):
if n==1:
return 1
else:
return n*faction(n-1)
data=input("你想算的积首项为多少")
result=faction(int(data))
print(result)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment