/**
*反转数组中的元素,count为数组元素的个数
*/
void reverseArray(int inarray[],int count) {
int temp, i, j, k = (count - 1) / 2;
for (i = 0; i < k; i++) {
j = count - 1 - i;
temp = inarray[i];
inarray[i] = inarray[j];
inarray[j] = temp;
}
}
数组反转
最新推荐文章于 2020-10-25 19:13:18 发布