glist.cpp

来自「数据结构c++语言描述 Borland C++实现」· C++ 代码 · 共 25 行

CPP
25
字号

// test formula-based linear list class
// with array expansion and reduction

#include <iostream.h>
#include "glist.h"
#include "xcept.h"

void main(void)
{
   try {
      LinearList<int> L;
      L.Insert(0,6).Insert(0,5).Insert(0,4).Insert(0,3);
      L.Insert(0,2).Insert(0,1).Insert(0,0);
      cout << "List is " << L << endl;
      int z;
      for (int i = 1; i < 6; i++) {
         L.Delete(1,z);
         cout << "Deleted element is " << z << endl;}
      }
   catch (...) {
      cerr << "An exception has occurred" << endl;
      }
}

⌨️ 快捷键说明

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