typedef struct
node
{
int
data;
struct
node
*next;
}node;
main()
{
struct
node
*p=null,*head=null,*previous=null;
while((c=getchar())!='Y')
{
p=(node *)malloc(sizeof(node));
if(p==null)
printf("创建链表失败"); break;
printf("请输入值");
scanf("%d",p->data);
if(head==null)
head=p;
previous=p;
else
previous->next=p;
previous=p;
}
}