1
1 def f(x): 2 if x == 0: 3 return 0 4 elif x == 1: 5 return 1 6 else: 7 return (x * f(x - 1)) 8 9 while 1: 10 info = int(input('>>>:')) 11 print(f(info)) 12 info = input('还想试试吗?(输入n退出)') 13 if info == 'n': 14 break