#include
#definemaxsize50
typedefstructnode
{
intdata[maxsize];
intlength;
}seqlink;
intlen1;
intlen2;
intarr[maxsize];
voidseqlinkinit(seqlink*l)//初始化
l->length=-1;
}
intcreatseqlink(seqlink*l)//建立順序表
while(1)
if(maxsize-1length)
printf("表滿!\n");
return0;
scanf("%d",&l->data[l->length]);
if(0==l->data[l->length])
break;
returnl->length;
voida(seqlink*l1,seqlink*l2)//求交集
inti,j;
intcount=0;
for(i=0;i
#include
#definemaxsize50
typedefstructnode
{
intdata[maxsize];
intlength;
}seqlink;
intlen1;
intlen2;
intarr[maxsize];
voidseqlinkinit(seqlink*l)//初始化
{
l->length=-1;
}
intcreatseqlink(seqlink*l)//建立順序表
{
while(1)
{
if(maxsize-1length)
{
printf("表滿!\n");
return0;
}
scanf("%d",&l->data[l->length]);
if(0==l->data[l->length])
{
break;
}
}
returnl->length;
}
voida(seqlink*l1,seqlink*l2)//求交集
{
inti,j;
intcount=0;
for(i=0;i