单项选择题
有以下程序:
#include <stdio.h>
#include <stdlib.h>
struct NODE
int num;
struct NODE *next;
;
main()
struet NODE *p,*q,*r;
int sum=0;
p=(struct NODE *) malloc(sizeof(struct NODE));
q=(struct NODE *) malloc(sizeof(struet NODE));
r=(struct 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
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <stdio.h> char fun(char x,char y) if(x<y) return x; return y; main() int a=’9’,b=’8’,c=’7’; printf( %c n ,fun(fun(a,b),fun(b,c))); 程序的执行结果是( )。
A.函数调用出错
B.8
C.9
D.7
点击查看答案&解析
单项选择题
有以下程序: #include <stdio.h> void f(int v, int w) int t; t=v; v=w; w=t; main() int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf( %d,%d,%d n ,x,y,z); 执行后的输出结果( )。
A.1,2,3
B.3,1,2
C.1,3,2
D.2,3,1
点击查看答案&解析
相关试题
有以下程序: #include <stdio.h> v...
有以下程序: #include <stdio.h> c...
有以下程序: #include <stdio.h> i...
有以下程序: #include <stdio.h> m...
有以下程序: #include <stdio.h> ...