static void Main(string[] args)
{
int[] a = new int[32];
for (int i = 0; i < a.Length; i++)
{
a[i] = i + 1;
}
int b = 0;
int c = 0;
List<int[]> k = new List<int[]>();
Combination(new int[3], a, b, c, ref k);
}
static void Combination<T>(T[] b, T[] a, int currentIndex, int currentFloor, ref List<T[]> list)
{
for (int i = currentIndex; (i <= currentIndex + a.Length - b.Length) && i < a.Length; i++)
{
b[currentFloor] = a[i];
if (currentFloor == b.Length - 1)
{
list.Add(b);
}
else
{
Combination(b, a, i + 1, currentFloor + 1, ref list);
}
}
}
{
int[] a = new int[32];
for (int i = 0; i < a.Length; i++)
{
a[i] = i + 1;
}
int b = 0;
int c = 0;
List<int[]> k = new List<int[]>();
Combination(new int[3], a, b, c, ref k);
}
static void Combination<T>(T[] b, T[] a, int currentIndex, int currentFloor, ref List<T[]> list)
{
for (int i = currentIndex; (i <= currentIndex + a.Length - b.Length) && i < a.Length; i++)
{
b[currentFloor] = a[i];
if (currentFloor == b.Length - 1)
{
list.Add(b);
}
else
{
Combination(b, a, i + 1, currentFloor + 1, ref list);
}
}
}