以下程序建立了一个带有头结点的单向,结点中的数据通过键盘输入,当输人数据为-1时,表示输入结束(头结点的data域不放数据,表空的条件是ph->next=NULL). include<stdio.h> struct list { int datd;struct list * next;}; 【 】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; 【 】=p; scanf('%d',&a); } p->next=/0; return(ph); } main( ) { struct list head; head=creatlist( ); }