import sys def jiec(n): if n<2: return 1 return n*jiec(n-1) for line in sys.stdin: a = line.split() # print(int(a[0]) ) print(jiec(int(a[0]))) 可以使用python3,会自动将大数值转为字符运算