题目内容

以下程序的功能是建立—个带有头结点的单向链表,链表结点中的数据通过键盘输入,当输入数据为-1时,表示输入结束(链表头结点的data域不放数据,表空的条件是ph->next==NULL),请填空。 #include<stdio.h> struct list { int data;struct list *next;}; struct list * creatlist() { struct list *p,*q,*ph;int a;ph=(struct list *)malloc(sizeof(struct list)); p=q=ph;printf("Input an integer number;entre-1 to end:\n"); scanf("%d",&a); while(a!=-1) { p=(struct list*)malloc(sizeof(struct list)); [14] =a;q->next=p; [15] =p;scanf("%d",&a);} p->next=’\0’;return(ph);} main() {stuct list * head;head=creatlist();}

查看答案
更多问题

长期股权投资采用成本法核算,投资企业确认的投资收益仅限于所获得的被投资企业在接受投资后产生的累计净利润的分配额。 ( )

A. 对
B. 错

以下程序的输出结果是______。 #include<string.h> main() {printf("%d\n",strlen("IBM\n012\1\\"));}

企业的固定资产预计报废清理费用,可作为弃置费用,按其现值计入固定资产成本,并确认为预计负债。( )

A. 对
B. 错

备齐所有的元器件,将元器件按要求排列,元器件布局要合理。

A. 对
B. 错

答案查题题库