单项选择题
有以下程序
#inGlude<stdlib.h>
struct NODE
int num;
struct NODE *next;
main()
struct NODE *p,*q,*r;
int sum=0;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(stnlct NODE*)malloc(sizeof(struct NODE));
p->num=1;q->num=2;r->num=3;
p->next=q;q->next;r;r->next=NULL;
sum+=q->next->Num,sum+=p->num;
printf("%d\n",sum);
执行后输出结果是
A.3
B.4
C.5
D.6
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
问答题
有以下程序 struct STU char name[10]; int num; ; void f1(struct STU C) struct STU b= LiSiGuo ,2042; c=b; void f2(struct STU*C) struct STU b= SunDan ,2044; *c=b; main() struct STU a= YangSan ,2041,b= Wang Yin ,2043; f1(
点击查看答案&解析
单项选择题
有以下程序 main() char k;int i; for(i=1;i<3;i++) scanf( %c ,&k); switch(k) case’0’:printf( another n ); case’1’:printf( number n ); 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是
A.another
number
anothor
B.another
number
number
C.another
number
D.number
number
点击查看答案&解析
相关试题
以下sum函数的功能是计算下列级数之和。 ...
以下程序的运行结果是 【19】 。 #in...
下面程序的运行结果是: 【17】 。 in...
以下sstrcpy()函数实现字符串复制,即将t...
下列程序的运行结果是: 【16】 。 #...