69,382
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#define MAXSIZE 100
typedef int ElemType;
typedef struct SeqList
{
ElemType elem[MAXSIZE];
int next;
}SeqList;
typedef SeqList *pSeqList;
void listInsert(pSeqList s,int p,ElemType e)
{
if(p<0||p>=MAXSIZE)
printf("越界!");
int i;
for(i=s->next-1;i>=p;i--)
s->elem[i+1]=s->elem[i];
s->elem[p]=e;
s->next++;
}