通過,測試的功能
""" author:claire data:2022年06月23 title = 數字的階乘 """
def factorial(n):
result = 1
for i in range(n,1,-1):
result *= i
print(result)
return result
n = int(input())
if n<0:
print("error")
elif n == 0:
print("0的階乘為1")
else:
print(f"{
n}的階乘為{
factorial(n)}")