namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{

int[] Arrays = new int[] { 24, 14, 35, 86, 55, 68, 15 };//创建一个数组名为Arrays的数组
Console.WriteLine("从小到大排序的数组");
for (int i = 0; i < Arrays.Length;i++ ) {//遍历Arrays数组
}
Array.Sort(Arrays);//使用Sort方法排序
for (int i = 0; i < Arrays.Length;i++ ) {
Console.Write(Arrays[i]+" ");//输出数组
}
Console.ReadLine();

 

Console.WriteLine();//分割线

 

Console.WriteLine("逆向排序后的数组")

for (int i = 0; i < Arrays.Length;i++ ) {//遍历Arrays数组

}
Console.ReadLine();
}
}
}

相关文章:

  • 2021-12-15
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2022-02-11
  • 2021-11-29
  • 2022-12-23
  • 2022-01-09
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案