diff options
author | Chris Lattner <sabre@nondot.org> | 2001-07-22 05:00:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-07-22 05:00:34 +0000 |
commit | 90147816f67d4adc90d8562b2d40da04f5152ecb (patch) | |
tree | 25cf4d238ae10f589d9a6ba4d82caf9cef748892 /test/combinations.c | |
parent | aceb9132b7c0f2b22a2e51d523d0bd46f2cb3817 (diff) | |
download | external_llvm-90147816f67d4adc90d8562b2d40da04f5152ecb.zip external_llvm-90147816f67d4adc90d8562b2d40da04f5152ecb.tar.gz external_llvm-90147816f67d4adc90d8562b2d40da04f5152ecb.tar.bz2 |
New test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/combinations.c')
-rw-r--r-- | test/combinations.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/combinations.c b/test/combinations.c new file mode 100644 index 0000000..cffdff1 --- /dev/null +++ b/test/combinations.c @@ -0,0 +1,11 @@ + + +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; + } +} |