请看一下,Sort()方法要降序排列应该怎样改
class Program
{
static void Main(string[] args)
{
int[] MyArray ={ 111,828,139,663,152,563,276};
Array.Sort(MyArray);
foreach (int num in MyArray)
{
Console.WriteLine(num);
}
Console.ReadKey();
}
}
------解决方案--------------------using System;
class Program
{
static void Main(string[] args)
{
int[] MyArray ={ 111, 828, 139, 663, 152, 563, 276 };
Array.Sort(MyArray);
Array.Reverse(MyArray);
foreach (int num in MyArray)
{
Console.WriteLine(num);
}
Console.ReadKey();
}
}