题解 | #走方格的方案数#
走方格的方案数
https://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
#include <stdio.h> int ans(int i, int j){ if(i == 1 || j == 1) return 1; return ans(i, j - 1) + ans(i - 1, j); } int main(){ int n, m; scanf("%d %d", &n, &m); if(n >= 1 && m <= 8) printf("%d", ans(n + 1, m + 1)); return 0; }