#include<stdio.h>
#define MAXSIZE 20
#define YES 0
#define NO 1
typedef int data_t;
typedef struct stu
{
data_t data[MAXSIZE];
int length;
}sq_list;
sq_list *CreateListSq()//申请内存空间
{
sq_list *sq=NULL;
if(NULL==(sq=(sq_list*)malloc(sizeof(sq_list))))
{
perror("create fail:");
exit(NO);
}
sq->length=0;
return sq;
}
int getele(sq_list *M,int i,data_t *n)//取出线性表中第i的一个元素
{
#define MAXSIZE 20
#define YES 0
#define NO 1
typedef int data_t;
typedef struct stu
{
data_t data[MAXSIZE];
int length;
}sq_list;
sq_list *CreateListSq()//申请内存空间
{
sq_list *sq=NULL;
if(NULL==(sq=(sq_list*)malloc(sizeof(sq_list))))
{
perror("create fail:");
exit(NO);
}
sq->length=0;
return sq;
}
int getele(sq_list *M,int i,data_t *n)//取出线性表中第i的一个元素
{