#include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct node
{
int data;
struct node*next;
};
typedef struct node NODE;
//主函数
int main()
{
NODE *head1,*head2,*head3;//定义3个头结点
void creatlink1();
void creatlink2();
void intersectionsetd();
void print();
head1 = (NODE*)malloc(sizeof(NODE));//申请头结点
head2 = (NODE*)malloc(sizeof(NODE));
head3 = (NODE*)malloc(sizeof(NODE));
printf("请输入数组A中各值:\n");
creatlink1(head1);
printf("请输入数组B中各值:\n");
creatlink2(head2);
intersectionsetd(head1, head2, head3);
printf("他们的交集C是:\n");
print(head3);
//printf("%d",head3->next->data);
return 0;
}
//创建单链表存放A
void creatlink1(NODE *h