#include <stdio.h>
void reverse(int *a,int length);
int main()
{
int a[12]={1,2,3,4,5,6,7,8,9,10,11,12,};
reverse(a,12);
}
void reverse(int *a,int length)
{
int i;
for (i=0; i<length/2; i++) {
int temp;
temp = a[i];
a[i]=a[length-i];
a[length-i]=temp;
}
for (i=0; i<length; i++) {
printf("%d ",a[i]);
}
}
请帮忙看一下代码错在哪了,谢谢