题解 | #n的阶乘#
n的阶乘
https://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
def cal_num(n): if n == 1: return 1 else: return n*cal_num(n-1) while True: try: num = int(input()) print(cal_num(num)) except EOFError: break
n的阶乘
https://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
def cal_num(n): if n == 1: return 1 else: return n*cal_num(n-1) while True: try: num = int(input()) print(cal_num(num)) except EOFError: break
相关推荐