📄 顺序表的就地逆置.cpp
字号:
#include<iostream>
using namespace std;
#define N 10
void main()
{
int i,j,t;
int list[N] = {1,2,3,4,5,6,7,8,9,10};
cout<<"the previous order of the list is "<<endl;
for(i=0;i<N;i++)
cout<<list[i]<<" ";
cout<<endl;
for(i=0,j=N-1;i<j; i++, j--)
{
t= list[i];
list[i] = list[j];
list[j] = t;
}
cout<<"the current order of the list is "<<endl;
for(i=0;i<N;i++)
cout<<list[i]<<" ";
system("pause");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -