import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNextInt()) {
int m = sc.nextInt();
int n = sc.nextInt();
System.out.println(cal(m,n));
}
}
private static int cal(int m,int n){
if(m==1 || n== 1){
return m+n;
}
return cal(m-1,n)+cal(m,n-1);
}
}
递归思路,每一种m,n的方块,就相当于m-1,n 和m,n-1的方块两种方案加起来