//泛型数组 冒泡排序
static T[] sort<T>(T[] x) where T:IComparable<T>
{
T b = default(T);
for (int i = 0; i < x.Length-1; i++)
{
for (int j = 0; j < x.Length-i-1; j++)
{
if (x[j].CompareTo(x[j+1])<0)
{
b = x[j];
x[j] = x[j + 1];
x[j + 1] = b;
}
}
}
return x;
}