#include <iostream>
#include <cmath>
#include<iomanip>
using namespace std;
//用线性表合并两个有序表
enum myerrorcode { rangeerror, success, overflow, underflow };
template<class T>
class list
{
public:
T data[1000];
int count;
list()
{
count = 0;
}
int length()
{
return count;
}
myerrorcode getelement(int i, T& x)
{
if (i <= 0 || i > count)
return rangeerror;
else
{
x = data[i - 1];
return success;
}
}
int locate(T x)
{
for (int i = 0; i < length(); i++)
{
if (data[i] == x)
return i + 1;
else
return -1;
}
}
myerrorcode insert(int i, T x)
{
if (count == 99)
return overflow;
if (i<1 || i>length() + 1)
return rangeerror;
for (int j = count - 1; j >= i - 1; j--)
{
data[j + 1] = data[j];
}
data[i - 1] = x;
count++;
return success;
}
myerrorcode deleteelement(int i)
{
if (length() =