使用正确的方法对 cars
数组进行排序。
string[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; @(5).@(4)(@(4)); foreach (string i in cars) { Console.WriteLine(i); }
string[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; Array.Sort(cars); foreach (string i in cars) { Console.WriteLine(i); }