#define MAXSIZE 50
typedef struct{
int data[MAXSIZE];
int size;
}LinerLink;
void InsertLink(LinerLink *line, int temp, int position)
{
int i=line->size;
if(position>line->size)
printf("输入错误,位置过大\n\n");
else
{
for(;i>position;i--)
{
line->data[i]=line->data[i-1];
}
line->size++;
line->data[position]=temp;
}
}
void DeleteLink(LinerLink *line, int position)
{
if(position>line->size)
printf("输入错误,位置过大\n\n");
else
{
for(;positionsize;position++)
{
line->data[position-1]=line->data[position];
}
line->size--;
}
}
阅读(1014) | 评论(0) | 转发(0) |