如下程序的功能为对链表中所有结点数据域内容求和,其中head指向一个带头结点的单链表,在下划线处需要分别填入的正确内容为______。 struct link{ int data; struct link * next; } int main(void){ struct link * head; sum(head); } int sum(_______){ struct link * p; int s=0; p=head->next; while(p){ s+=_______; p=_______; } }
A、struct link *head p->datap->next;
B、struct link headp->datap->next;
C、struct link *head p->next->datap->next;
D、struct link *head p->datap
发布时间:2024-10-24 19:36:11