C#数组反转
static void Main(string[] arr) { string[] names = { "老杨1", "老李2", "老王3", "老牛4", "老虎5", "老磁6" }; for (int i = 0; i < names.Length/2; i++) { string temp = names[i]; names[i] = names[(names.Length - 1) - i]; names[(names.Length - 1) - i] = temp; } for (int i = 0; i < names.Length; i++) { Console.WriteLine(names[i]); } Console.ReadKey(); } }