#include
void change(int *n, int len)
{
int a, *p= &a;
for(int i= 0; i < len/2; i++)
{
*p= *(n+i);
*(n+i)= *(n+len-1-i);
*(n+len-1-i)= *p;
}
}
void main()
{
int a[10]={1,2,3,4,5,6,7,8,9,10};
change(a, 10);
for(int i= 0; i < 10; i++)
cout<cout<
#include
void main()
{
int a[10] = {1,2,3,4,5,6,7,8,9,10};
int *p = new int[10];
int *temp = p;
int i = 9;
while (i>=0)
{
*p++ = a[i--];
}
while(*temp>0)
printf("%d\t",*temp++);
}
用指针去接收数组的首地址,就可以了,好久没有写C的,不好写,怕写出错!
编程题目:把1,2,3,4,56,7,8,9,10存放到数组中,
并按照10,9,8,7,6,5,4,3,2,1的顺序输出
给分吗??