目录
(1)元素逆置
#include<iostream>
using namespace std;
int main()
{
int a[] = { 6,7,5,15,36,1,0,8};
int start = 0;
int end = sizeof(a) / sizeof(a[0])-1;
int end1 = end;
int temp;
while (end>start)
{
temp = a[end];
a[end] = a[start];
a[start] = temp;
end=end-1;
start=start+1;
}
for (int i = 0; i <=end1; i++)
{
cout << a[i] << endl;
}
}