题目内容

执行下列程序,输入为1的运行结果是:#include int main(){int k;scanf("%d",&k);switch(k){case 1:printf("%d ",k++);break;case 2: printf("%d ",k++);case 3: printf("%d ",k++);break;case 4: printf("%d ",k++);default:printf("Full!\n");}return 0;}

A. 1
B. 2
C. 2 3 4 5
D. 1 2 3 4

查看答案
更多问题

执行下列程序,输入为3的运行结果是:#include int main(){int k;scanf("%d",&k);switch(k){case 1:printf("%d ",k++);break;case 2: printf("%d ",k++);case 3: printf("%d ",k++);break;case 4: printf("%d ",k++);default:printf("Full!\n");}return 0;}

A. 3
B. 4
C. 3 4
D. 4 5

执行下列程序,输入为1的运行结果是:#include int main(){int k;scanf("%d",&k);switch(k){case 1: printf("%d ",k++);case 2: printf("%d ",k++);case 3: printf("%d ",k++);case 4: printf("%d ",k++);break;default:printf("Full!\n");}return 0;}

A. 1
B. 2
C. 2 3 4 5
D. 1 2 3 4

执行下列程序,输入为3的运行结果是:#include int main(){int k;scanf("%d",&k);switch(k){case 1: printf("%d ",k++);case 2: printf("%d ",k++);case 3: printf("%d ",k++);case 4: printf("%d ",k++);break;default:printf("Full!\n");}return 0;}

A. 3
B. 4
C. 3 4
D. 4 5

以下程序的运行结果是:#include int 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;}printf("a=%d,b=%d\n",a,b);return 0;}

A. a=2,b=1
B. a=1,b=1
C. a=1,b=0
D. a=2,b=2

答案查题题库