using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace PruebasCSharp
{
class Program
{
public static int comparar(string[] x, string[] y)
{
int num1, num2;
num1 = Convert.ToInt32(x[0]);
num2 = Convert.ToInt32(y[0]);
if (num1 > num2)
return 1;
else
if (num1 < num2)
return -1;
else return 0;
}
public static void Order(ref List<string> lMulti, ref List<string> lNivel, Comparison<string[]> comparar)
{
List
<string[]> listacomb
= new List
<string[]>(lMulti
.Count);
for(int i=0;i<listacomb.Capacity;i++)
{
listacomb
.Add(new string[] { lMulti
[i
], lNivel
[i
] }); }
listacomb.Sort(comparar);
for (int i = 0; i < listacomb.Count; i++)
{
lMulti[i] = listacomb[i][0];
lNivel[i] = listacomb[i][1];
}
}
static void Main(string[] args)
{
List
<string> lMulti
= new List
<string>(new String[] {"2",
"1",
"3"}); List
<string> lNivel
= new List
<string>(new String[] {"2x",
"1x",
"3x"});
Order(ref lMulti, ref lNivel,comparar);
}
}
}