⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 顺序表的就地逆置.cpp

📁 顺序表的就地逆置算法,文档中有程序实现算法的代码与可运行源程序
💻 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 + -