单项选择题
有以下程序:
#include<stdio.h>
main()
int c=0,k;
for(k=1;k<3;k++)
switch(k)
default:c+=k;
case2:c++;break;
case4:c+=2;break;
printf("%d\n",c);
程序运行后的输出结果是( )。
A.3
B.5
C.7
D.9
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include<stdio.h> main() int a[]=2,3,5,4,i; for(i=0;i<4;i++) switch(i%2) case0:switch(a[i]%2) case0:a[i]++;break; case1:a[i]--; break; case1:a[i]=0; for(i=0;i<4;i++)printf( %d ,a[i]);printf( n ); 程序运行后的输出结果是( )。
A.3344
B.2050
C.3040
D.0304
点击查看答案&解析
问答题
有以下程序: #include<stdio.h> #include<string.h> struct A int a;char b[10];double c;; Struct A f(struct A t): main() struct A a=1001, ZhangDa ,1098.0; a=f(a);printf( %d,%s,%6.1f n ,a.a,a.b,a.c); struct A f(struct A t) t.a=1002;strcpy(t.b, ChangRong );t.c=1202.0;return t; 程序运行后的输出结果是( )。
点击查看答案&解析
相关试题
有以下程序: #include<stdio.h> mai...
若有语句“doube x=17;int y;”,当...
有以下程序: #include<stdio.h> fun...
有以下程序: #include<stdio.h> typ...
以下程序运行后的输出结果是______。...