mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-15 20:06:46 +00:00
90147816f6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268 91177308-0d34-0410-b5e6-96231b3b80d8
12 lines
183 B
C
12 lines
183 B
C
|
|
|
|
void combinations(unsigned int n, unsigned *A) {
|
|
unsigned int i, t = 1;
|
|
A[0] = A[n] = 1;
|
|
|
|
for (i = 1; i <= n/2; i++) {
|
|
t = (t * (n+1-i)) / i;
|
|
A[i] = A[n-i] = t;
|
|
}
|
|
}
|