# define Maxsize 100
# define N 2
Typedef struct {
Char number [5].
Char name [20].
int age;
Char sex [5].
Char symptom [50].
} patient;
Typedef patient Elemtype;
H # include "hell."
Int main (void)
{
Patient s;
SequenceList mylist.//order table
int i;
ListInit (& amp; Mylist);//initialization sequence table
for(i=0; i
The scanf (" % s ", s.n umber);
The scanf (" % s ", s.n ame);
The scanf (" % s ", s.a ge);
The scanf (" % s ", s.s ex);
The scanf (" % s ", s.s ymptom);
ListInsert (& amp; Mylist, I, s);
}
return 0;
}
# include
Typedef struct {
Elemtype list [Maxsize];
int size;
} SequenceList;
Void ListInit (SequenceList * L);//initialization sequence table
Int ListLength SequenceList (L);//calculate the length of the sequence table
Int ListInsert (SequenceList * L, int I, Elemtype x);//insert
Int ListDelete (SequenceList * L, int I Elemtype * x).//delete
Int ListGet (int I SequenceList L, Elemtype * x).//traversal
Void ListInit (SequenceList * L)
{
L-> Size=0;
return;
}
Int ListLength SequenceList (L)
{
Return L.s considering;
}
Int ListInsert (SequenceList * L, int I Elemtype x)
{
Int j;
if(L-> Size==Maxsize)
{
Printf (" sequence table is full can't insert ");
return 0;
}
Else if (i<0 | | i> L-> The size)
{
Printf (" parameters I illegal!" );
return 0;
}
The else
{
For (j=L - & gt; size; J> i; J -)
L-> The list [j]=L - & gt; List] [j - 1;//I location element back
L-> The list [I]=x;
L-> Size++;
return 1;
}
}
Int ListGet (int I SequenceList L, Elemtype * x)
{
If (i<0 | | i> L.s considering 1)
{
Printf (" parameter illegal ");
return 0;
}
The else
{
* x=L.l ist [I];
return 1;
}
}
CodePudding user response:
Above the # define a piece of code there is the main function, and include something omittedCodePudding user response:
H # include "hell." this is an errorCodePudding user response:
The