def factorial(n): """计算n的阶乘""" if n == 0 or n == 1: return 1 else: return n * factorial(n - 1) # 读取多组输入,直到没有输入为止 try: while True: n = int(input()) print(factorial(n)) except EOFError: pass # 当没有更多输入时退出循环