题解 | #走方格的方案数#
走方格的方案数
https://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
n,m = list(map(int,input().split())) # n为横向的格子数,m为竖向的格子数
def f(x,y):
if x == 0 or y == 0:
return 1 # 路径只有一条
else:
return (f(x-1,y) + f(x,y-1))
print(f(n,m))



小天才公司福利 1152人发布