“你有一个横6竖6的方格……”

你现在在左上第一个格子里,你的任务是移动到最右下脚的格子里,你每次只能向右或者向下移动,不能斜向移动,也不能后退。

你能找出几种方法移动到最右下脚的格子?


function c(n,m)
    if n==0 or m==0 then
        return 0
    end

    if n==1 and m==2 then
        return 1
    end

    if n==2 and m==1 then
        return 1
    end


    return c(n-1,m)+c(n,m-1)
end

print(c(6,6))