C#里对数组的排序操作
一般情况下是采用
Array.Sort(a)
来进行排序。
例子代码如下:
/*
* C# Program to Sort a String using Predefined Function
*/
using System;
class linSearch
{
public static void Main()
{
Console.WriteLine("Enter Number of Elements you Want to Hold in the Array? ");
string s = Console.ReadLine();
int x = Int32.Parse(s);
int[] a = new int[x];
Console.WriteLine("Enter Array Elements :");
for (int i = 0; i < x; i++)
{
string s1 = Console.ReadLine();
a[i] = Int32.Parse(s1);
}
原文地址:https://blog.csdn.net/caimouse/article/details/143655810
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!