Skip to content

Instantly share code, notes, and snippets.

@lmatt-bit
Created May 8, 2012 15:12
Show Gist options
  • Select an option

  • Save lmatt-bit/2636116 to your computer and use it in GitHub Desktop.

Select an option

Save lmatt-bit/2636116 to your computer and use it in GitHub Desktop.
杨辉三角求C(N, K)
for(int i = 0; i <= N; i++)
{
for(int j = 0; j < i + 1; j++)
{
if(j == 0 || i == j) d[i][j] = 1;
else d[i][j] = d[i - 1][j] + d [i - 1][j - 1];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment