大家好,又见面了,我是你们的朋友全栈君。
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(); } }
转载于:https://www.cnblogs.com/zywf/p/4483368.html
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/133448.html原文链接:https://javaforall.net