-->
当前位置:首页 > 题库

单选题:以下程序的输出结果是()。

Luz4年前 (2022-10-10)题库490
以下程序的输出结果是()。
struct NODE{ int num; struct NODE * next;};
int main(void)
{ struct NODE *p, *q, *r;
p=(struct NODE *)malloc(sizeof(struct NODE));
q=(struct NODE *)malloc(sizeof(struct NODE));
r=(struct NODE *)malloc(sizeof(struct NODE));
p->num = 10; q->num=20; r->num = 30;
p->next =q; q->next = r;
printf(“%d\n”, p->num+q->next->num);
return 0; }



A.10
B.20
C.30
D.40


答案:D