static int[] SortArray(int[] array)
{
var result = new int[array.Length];
int count = 0;
for (int i = 0; i < array.Length; i++)
{
if ((array[i] & 1) != 0)
{
array[i] = result[count];
count++;
}
}
Array.Sort(result);
int temp;
for (int i = 0; i < array.Length-1; i++)
{
if ((array[i] % 1)==0)
{
temp = result[i];
result[i] = array[i];
result[i + 1] = temp;
}
}
return result;
}
var array = new[] { 55, 2, 9, 99, 12, 13, 23, 32, 5, 11, 1 };
for (var first = 0; first < array.Length; first++)
{
for (var second = first; second < array.Length; second++)
{
if (array[first] % 2 == 1 && array[second] % 2 == 1 && array[first] > array[second])
{
var temp = array[first];
array[first] = array[second];
array[second] = temp;
}
}
}