当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

有以下程序 include<stdio.h> main() {intx=1,y=0,a=0,b=0; switch(x) {case1: switch


有以下程序

#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

参考答案
您可能感兴趣的试题
  • 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;main(){ printf("%d ",strlen (

  • 试题32有以下程序#include <stdio.h>#include <string.h>main(){ char a[5][10]={“c

  • 有以下程序#include<stdio.h>#include<string.h>main(){char str[][20]={“Qne*World

  • 有以下程序#include<stdio.h>#include<string.h>main(){char a[10]=”abcd”;prinff(“

  • 有以下程序#include<stdio.h>#include<string.h>main( ){char x[]=“STRING”;x[0]=0;

  • 有以下程序#include <stdio.h>main(){ int num=0; while( num <=2) { num++; printf(\%