题解 | #走方格的方案数#
走方格的方案数
http://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
#include <iostream> using namespace std; int GetNum(int raw, int col) { if(raw == 1 || col == 1) { return raw+col; } else { return GetNum(raw-1, col) + GetNum(raw, col-1); } } int main() { int raw,col; while(cin>>raw>>col) { cout<<GetNum(raw, col)<<endl; } return 0; }