数组反转

/**
 *反转数组中的元素,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;
	}
}

你可能感兴趣的:(java,J#)