下面是对应的VB.NET代码: Dim x As Integer
Dim names(3) As String
names(0) = "Howard, Ryan"
names(1) = "Allen, Ray"
names(2) = "Pujols, Albert"
names(3) = "Iverson, Allen"
For x = 0 To (names.Length - 1)
Console.WriteLine(CStr(x) + ". " + names(x).ToString())
Next x
Array.Sort(names)
For x = 0 To (names.Length - 1)
Console.WriteLine(CStr(x) + ". " + names(x).ToString())
Next x