单项选择题
有以下程序:
#include <stdlib.h>
struct NODE
int num; struct NODE *next; ;
main()
struct NODE *p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)mallloc(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);
程序运行后的输出结果是( )。
A) 10
B) 20
C) 30
D) 40
热门
试题
单项选择题
现有如下程序段: #include stdio.h main() int a[5][6]=23,3,65,21,6,78,28,5,67,25,435,76,8,22,45,7,8,34,6,78,32,4,5,67,4,21,1; int i=0,j=5; printf( %d n ,*(&a[0][0]+2*i+j-2)); 则程序的输出结果是
A) 78
B) 23
C) 21
D) 28