1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/combinations.c
Chris Lattner 5f04e68842 New test case
llvm-svn: 268
2001-07-22 05:00:34 +00:00

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;
}
}