#include<iostream>
using namespace std;
struct List
{
int* date;
int const maxN 100;
int length;
List();
bool is_empty(List L); //判断是否为空
bool is_full(List L); //判断是否满
int Length();//获取长度
void insert(int n); //插入
void print();//输出
};
List(int n)
{
date = new int[maxN];
length = n;
};
bool is_empty(List L)
{
if (L.length == 0)
return true;
else
return false;
};
bool is_full(List L)
{
if (L.length == maxN)
return true;
else
return false;
};
int Length()
{
return length;
}
void insert(int n)
{
if (!isfull(L))
L.date[length] = n;
length = length + 1;
else
reurn 0;
};
void print()
{
if(is_empty(L))
{
cout << "数组为空";
}
else
{
for (int i = 0; i < L.length; ++i)
cout << L.date[i];
cout << endl;
}
}
int main()
{
List a;
a.insert(10);
a.search(5);
a.insert(5);
a.print();
return 0;
}