#define max 10
typedef struct
{
int elem[max];
int length;
}Seqlist;
void Same(Seqlist&A,Seqlist&B,Seqlist&C)
{
int i,j,k=0,lena=A.length,lenb=B.length;
for(i=0;i<lena;i++)
{
for(j=0;j<lenb;j++)
{
if(A.elem[i]==B.elem[j])
{
C.elem[k++]=A.elem[i];
break;
}
}
}
C.length=k;
}
2.25-将顺序表A,B的交集用C存储
最新推荐文章于 2021-05-18 03:42:09 发布