#include<iostream>
using namespace std;
#define MAXSIZE 100
#define ADDSIZE 10
#define OK 1
#define TRUE 1
#define FALSE 0
#define ERROR 0
typedef struct {
int* elem;
int length;
}SqList;
int InitList(SqList& L) {//初始化线性表
L.elem = new int[MAXSIZE];
if (!L.elem)
exit(OVERFLOW);
L.length = 0;
return OK;
}
void DestoryList(SqList& L) {//销毁线性表
if (L.elem)
delete L.elem;
}
void ClearList(SqList& L) {//清空线性表
if (L.length != 0)
L.length = 0;
}
int ListInsert(SqList& L, int i, int e) {//在线性表中i的位置插入元素e
if (i<1 || i>L.length + 1)
return ERROR;
if (L.length == MAXSIZE)
return ERROR;
for (int j = L.length - 1; j >= i - 1; j--)