1 n = int(input("请输入一个整数:")) 2 if n % 1 == 0: 3 s = 1 4 for i in range(1, n): 5 s *= i 6 print(f"{n}! = {s}") 7 else: 8 print("输入的不是整数,error")