填空题 以下程序建立了一个带有头结点的单向链表,链表结点中的数据通过键盘输入,当输人数据为-1时,表示输入结束(链表头结点的data域不放数据,表空的条件是ph->next=NULL).
# include<stdio.h>
struct list int datd;struct list * next;;
{{U}} 【19】 {{/U}} creatlist( )
struct list * p,*q,*ph;
int a;
ph= (struct list*)malloc(sizeof(struct list));
p=q=ph;
printf("Input an integer number,enter-1 to end:/n");
scanf("%d",&a);
while(a!=-1)

p=(struct list * )malloc(sizeof(struct list));
p->data=a;
q->next=p;
{{U}} 【20】 {{/U}} =p;
scanf("%d",&a);

p->next='/0';
return(ph);

main( )

struct list head;
head=creatlist( );


  • 1、
【正确答案】 1、{{*HTML*}}[19]struct list *
[20] q
    
【答案解析】