题目链接:http://www.codeforces.com/problemset/problem/509/A
题意:f[i][1]=f[1][i]=1,f[i][j]=f[i-1][j]+f[i][j-1],求f[n][n]。
C++代码:
#include <iostream>
using namespace std;
int n, f[][];
int main()
{
cin >> n;
for (int i=;i<=n;i++)
f[i][] = f[][i] = ;
for (int i = ; i <= n; i ++)
for (int j = ; j <= n; j ++)
f[i][j] = f[i-][j] + f[i][j-];
cout << f[n][n];
return ;
}
C++