function $CL(arr, n, noLC, arrDan)
{ //从arr中取n个组合,然后
var r = [], sum = 0;
n = n - arrDan.length;
(function f(t, a, n)
{
if (n == 0)
return r.push(t);
if (a.length < 1)
return;
for (var i = 0,l = a.length - n; i <= l; i++)
{
f(t.concat(a[i]), a.slice(i + 1), n - 1);
}
})(arrDan, arr, n);
if (noLC)
return r; //返回一个组合数组[[],[],[]]
for (var i = r.length; i--; )
sum += get1(r[i]); //计算每个组合的连乘的和
return sum;
};
function $CLDT(arr_D, arr_T, n, noLC)
{
//从arr中取n个组合,然后
var r = [], sum = 0;
(function f(t, a, n)
{
if (n == 0) return r.push(t);
for (var i = 0,l = a.length - n; i <= l; i++)
{
f(t.concat(a[i]), a.slice(i + 1), n - 1);
}
})(arr_D, arr, n);
if (noLC)
return r; //返回一个组合数组[[],[],[]]
for (var i = r.length; i--; )
sum += get1(r[i]); //计算每个组合的连乘的和
return sum;
};