将一个字符串数组的元素顺序时行反转

//练习:将一个字符串数组的元素顺序时行反转
string[] names={"我","是","好人"};
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;
}

posted @ 2014-11-08 11:02  teacherzj  阅读(370)  评论(0编辑  收藏  举报