#include <iostream>
#define SIZE 10
using namespace std;
typedef struct LNode
{
int data;
struct LNode *next;
};
void reverseArray(int a[],int s) //数组的逆置函数
{
int i=0,j=s,temp;
for(;i<j;i++,j--) //简单的交换
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
void reverseLinkList(LNode *p,LNode *q ) //链表的逆置函数 ,从p节点到q节点逆置
{
LNode *r=NULL;
while(p->next!=q) //相当于挖出来一个节点,连接到q的节点之后
{
p->next=r;
p->next=r->next;
r->next=q->next;
q->next=r;
}
}
int main()
{
int a[SIZE],i=0;
while(i<SIZE)
{
a[i]=i;
i++;
}
reverseArray(a,SIZE);
for(int i=0;i<SIZE;i++)
{
cout<<a[i]<<"\t";
}
return 0;
}