数字排序
using System;
class Order
{
public Order(string a,params double[] arry)
{
if (a == "正序")
{
for (int i = 0; i < arry.Length - 1; i++)
{
for (int j = 0; j < arry.Length - i - 1; j++)
{
if (arry[j] > arry[j + 1])
{
double b;
b = arry[j];
arry[j] = arry[j + 1];
arry[j + 1] =b;
}
}
}
}
else if (a == "倒序")
{
for (int i = 0; i < arry.Length - 1; i++)
{
for (int j = 0; j < arry.Length - i - 1; j++)
{
if (arry[j] < arry[j + 1])
{
double b;
b = arry[j];
arry[j] = arry[j + 1];
arry[j + 1] = b;
}
}
}
}
else
{
}
}
}