Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
public class Binomial
|
||||
{
|
||||
private static long binom(int n, int k)
|
||||
{
|
||||
if (k==0)
|
||||
return 1;
|
||||
else if (k>n-k)
|
||||
return binom(n, n-k);
|
||||
else
|
||||
return binom(n-1, k-1)*n/k;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.println(binom(5, 3));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue