using System;
public class HelloWorld
{
public static void Main()
{
string[] names = { "a", "b", "c","d", "e", "f" };//声明一个string类型的数组
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();
}
}