【单选题】【消耗次数:1】
下述程序的运行结果( )。 #includevoid main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); } case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); }
a=1,b=1
a=2 ,b=1
a=2,b=2
a=3,b=3
参考答案:
复制
纠错
相关题目
【单选题】 下述程序的运行结果( )。 #includevoid main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); }
①  a=2,b=1
②  a=1,b=2
③  a=0,b=1
④  a=1,b=0
【单选题】 有如下程序:main(){  intx=1,a=0,b=0;  switch(x){  case0:b++;case1:a++;case2:a++;b++;}  printf(“a=%d,b=%d\n”,a,b);}该程序的输出结果是()
①  a=2 b=1
②  a=1 b=1
③  a=1 b=0
④  a=2 b=2
【单选题】 以下程序段:int i,a=3,b=2;i=(--a==b++)?--a:++b;printf(i=%d a=%d b=%d,i,a,b);输出结果是。
①  i=1 a=1 b=3
②  i=3 a=2 b=3
③  i=4 a=1 b=4
④  i=4 a=2 b=4
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=1,b=2,c=3; if(c=a)printf(%d\n else printf(%d\n }
①  1
②  3
③  5
④  6
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=5,b=4,c=3,d=2; if(ac)printf(%d\n else if((c-1=d)==1)printf(%d\n,d+1); else printf(%d\n,d+2); }
①  0
②  1
③  2
④  3
【单选题】 有以下程序#includestdio.hmain(){ int a=1,b=0;if(--a) else if(a==0) b+=2;else b+=3;printf(“%d\n”,b); }程序运行后的输出结果是(  )。
①  0
②  1
③  2
④  3
【单选题】 有以下程序#includestdio.hmain(){ int a=1,b=0;if(--a) else if(a==0) b+=2;else b+=3;printf(“%d\n”,b); }程序运行后的输出结果是。
①  0
②  1
③  2
④  3
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=5,b=4,c=3,d=2; if(ac)printf(%d\n else if((c-1=d)==1)printf(%d\n,d+1); else printf(%d\n,d+2); }
①  1
②  2
③  3
④  4
【单选题】 有如下程序: #includevoid main( ) { int a=2,b=-1,c=2; if (ab) if (b0) c=0; else c++; printf(%d\n } 该程序的输出结果是
①  0
②  1
③  2
④  3
【单选题】 以下程序的输出结果是()。 main( ) { int b[3][3]={0,1,2,0,1,2,0,1,2},i,j,t=0; for(i=0;i for(j=i;j t=t+b[i][b[j][j]]; printf(%d\n,t); }
①  3
②  4
③  1
④  9
随机题目
【多选题】 计算机网络安全设计遵循的基本原则包括( ),以及动态化原则等。
①  整体原则
②  有效性有效性与实用性原则
③  安全评价性原则
④  等级性原则
【单选题】 下面不是计算机网络面临的主要威胁的是( )。
①  恶意程序威胁
②  计算机软件面临威胁
③  计算机网络实体面临威胁
④  计算机网络系统面临威胁
【判断题】 恶意代码的关键技术包括:生存技术、攻击技术和隐藏技术。
①  正确
②  错误
【判断题】 从工作原理角度看,防火墙主要可以分为网络层和数据层。
①  正确
②  错误
【多选题】 使用基于路由器的防火墙使用访问控制表实现过滤,它的缺点有:( )。
①  路由器本身具有安全漏洞
②  分组过滤规则的设置和配置存在安全隐患
③  无法防范“假冒”的地址
④  对访问行为实施静态、固定的控制与路由器的动态、灵活的路由矛盾
【多选题】 按照防火墙对数据的处理方法,可将防火墙分为( )两类。
①  数据包过滤防火墙
②  DNS防火墙
③  代理防火墙
④  网络服务防火墙
【多选题】 典型的防火墙体系结构包括( )。
①  双宿主机结构
②  代理主机结构
③  屏蔽主机结构
④  屏蔽子网结构
【多选题】 防火墙不能防止以下哪些攻击行为( )。
①  内部网络用户的攻击
②  传送已感染病毒的软件和文件
③  外部网络用户的IP地址欺骗
④  数据驱动型的攻击
【单选题】 入侵检测系统的第一步是:( )。
①  信号分析
②  信息收集
③  数据包过滤
④  数据包检查
【单选题】 端口扫描的原理是向目标主机的( )端口发送探测数据包,并记录目标主机的响应。
①  FTP
②  UDP
③  TCP/IP
④  WWW