单项选择题
有以下程序:
#include<stdio.h>
main()
int x=1,y=0,a=0,b=0;
switch(x)
case 1:
switch(y)
case 0:a++;break;
case 1: b++;break;
case 2:a++;b++;break;
case 3:a++;b++;
printf("a=%d,b=%d\n",a,b);
程序的运行结果是______。
A.a=1,b=0
B.a=2,b=2
C.a=1,b=1
D.a=2,b=1
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: struct STU char name[10];int num;float TotalScore;; void f(struct STU*P) struct STU s[2]= SunDan ,20044,550, Penghua ,20045,537,*q=s; ++P;++q;*P=*q; main() struct STU s[3]= YangSan ,20041,703), LiSiGuo ,20042,580; f(s); printf( %s%d%3.0f n ,s[1].name,s[1].num,s[1].TotalScore); 程序运行后的输出结果是______。
A.SunDan 20044 550
B.Penghua 20045 537
C.LiSiGuo 20042 580
D.SunDan 20041 703
点击查看答案&解析
单项选择题
有以下程序: #inlucde<stdio.h> main() D) 2 3 3 int n,*P=NULL; *p=&n; printf( input n: );scanf( %d ,&p);printf( output n: );printf( %d n ,p); 该程序试图通过指针P为变量n读入数据并输出,但程序有多处错误,以下语句正确的是______。
A.int n,*P=NULL;
B.*P=&n;
C.scanf(“%d",&p)
D.printf("%d\n",p);
点击查看答案&解析
相关试题
i%2或i%2==1
以下程序运行后的输出结果是______。...
以下程序中函数fun的功能是:统计person所...
j+1
以下程序的功能是:求出数组x中各相邻两个...