testprogarraybasedlist.cpp

来自「data+structures+using+c的源码」· C++ 代码 · 共 36 行

CPP
36
字号
#include <iostream>
#include "orderedArrayListType.h"

using namespace std;

int main()
{
	orderedArrayListType<int> list;					//Line 1
	int num;										//Line 2

	cout<<"Line 3: Enter numbers ending with -999"
        <<endl;										//Line 3

	cin>>num;										//Line 4

	while(num != -999)								//Line 5
	{
		list.insert(num);							//Line 6
		cin>>num;									//Line 7
	}

	cout<<"Line 8: The list before sorting:"<<endl;	//Line 8
	list.print();									//Line 9
	cout<<endl;										//Line 10

	list.selectionSort();							//Line 11

	cout<<"Line 12: The list after sorting:"<<endl;	//Line 12
	list.print();									//Line 13
	cout<<endl;										//Line 14

	return 0;
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?