网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
请阅读以下程序:includemain(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ c

请阅读以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 2: a++,b++;break;} printf("a=%d,b=%d\n" ,a,b); 上面程序的输出结果是( )。

A.a=2,b=1

B.a=1,b=1

C.a=1,b=0

D.a=2,b=2


参考答案

更多 “ 请阅读以下程序:includemain(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ c 请阅读以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 2: a++,b++;break;} printf("a=%d,b=%d\n" ,a,b); 上面程序的输出结果是( )。A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2 ” 相关考题
考题 有以下程序#include stdio.hmain(){ 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=0B)a=2, b=2C)a=1, b=1D)a=2, b=1

考题 阅读下面程序,则在执行时候的输出为 【8】 。#include "stdio.h"main(){int x=1,y=2,z=0;if(x=2)z=x,x=y,y=z;printf("%d,%d\n",x,y);}

考题 有以下程序:includeint f(int x){int y;if(x==0||x==1)return(3);y=x*x-f(x-2);return 有以下程序: #include<stdio.h> int f(int x) {int y; if(x==0||x==1)return(3); y=x*x-f(x-2); return y; } main() {int z; z=f(3);printf("%d\n",z); } 程序的运行结果是( )。A.0B.9C.6D.8

考题 请阅读以下程序:#includestdio.hmain(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ case 0:a++;break; }case 2:a++,b++;break; }printf(" a=%d,b=%d\n",a,b);上面程序的输出结果是A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 请阅读以下程序:includemain(){int x=1,y=0,a=0,b=0;switch(x){case 1:switch(y){case 请阅读以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break;} case 2: a++,b++;break;} printf("a=%d,b=%d\n",a,b); 上面程序的输出结果是A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 有以下程序#include stdio.hmain(){ 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=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 有以下程序:includemain(){intx=1,y=0,a=0,b=0;switch(x){case 1:switch(y){case 0:a+ 有以下程序: #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=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 以下程序段的运行结果是( )。 include main() {int x=2,y=1: switch(x) {case 1: switch 以下程序段的运行结果是( )。 include<stdio.h> main() {int x=2,y=1: switch(x) {case 1: switch(y) {case 0:printf("x=2,y=1\n");break; case 1:printf("y=1\n");break; } case 2:printf("x=2\n"); } }

考题 如下程序的输出结果是______。 include main() { int x=1,a=3,b=4; switch(x) { case 0 如下程序的输出结果是______。 #include<stdio.h> main() { int x=1,a=3,b=4; switch(x) { case 0:a--; case 1:b--; case 2:a--;b--; } printf("a=%d,b=%d\n",a,b); }A.a=2,b=2B.a=3,b=3C.a=1,b=2D.a=3,b=2

考题 请阅读以下程序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;}cout<<"a="<<a<<"b="<<b<<endl;}上面程序的输出结果是A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 有如下程序:includemain(){int x=1,a=0,b=0; switch(x) {casc 0:b++;case 1:a++;case 有如下程序: #include<stdio.h> main() { int x=1,a=0,b=0; switch(x) { casc 0:b++; case 1:a++; case 2:a++;b++; } printf("a=%d,b=%d\n",a,b); } 该程序的输出结果是( )。A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for( 有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。A.10B.11C.14D.15

考题 有如下程序:includevoid main(){int x=1,a=0,b=0;switch (x){Case 0: b++;Case 1: 有如下程序:#include<iostream.h>void main(){int x=1,a=0,b=0;switch (x){Case 0: b++;Case 1: a++;Case 2: a++; b++;}cout<<"a="<<a<<","<<"b="<< b;}该程序的输出结果是( )。A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 请选出以下程序的输出结果includemain(){ int a[]={1,2,3,4},i;int x=0;for(i=0;i 请选出以下程序的输出结果 #include<stdio.h> main() { int a[]={1,2,3,4},i; int x=0; for(i=0;i<4;i++) { sub(a,x);printf("%d",x);} printf("\n");} sub(s,y) int*s,y; { static int t=3; y=s[t];t--; }A.1 2 3 4B.4 3 2 1C.0D.4444

考题 有以下程序includemain(){intx=1,y=0,a=0,b=0;switch(X){case1:switch(y){case0:a++;b 有以下程序 #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=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 有下列程序:includemain(){int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ case 0 有下列程序: #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=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 有下列程序: include int f(int x) { int y; if(x=0‖x==1)r 有下列程序: #include <stdio.h> int f(int x) { int y; if(x=0‖x==1)return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3);printf("%d\n",z); 程序的运行结果是( )。A.0B.9C.6D.8

考题 有以下程序:includevoid main(){ int x=5,y=2; cout 有以下程序: #include<iostream.h> void main() { int x=5,y=2; cout<<!(y==x/2)<<","; cout<<y!=x%3)<<","; cout<<(x>0y<0)<<","; cout<<(x!=y‖x>=y)<<endl: } 程序执行后的输出结果是( )A.0,0,0,1B.1,1,1 1C.0,0, 1,1D.1,1,0,0

考题 以下程序的输出结果是()。includemain(){int a=8,b=6,m=1;switch(a%4){case 0:m++;brea 以下程序的输出结果是( )。 #include<stdio.h> main() {int a=8,b=6,m=1; switch(a%4) {case 0:m++; break; case 1:m++; switch(b%3) {default:m++; case 0:m++;break; } } printf("%d\n",m);}A.1B.2C.3D.4

考题 有以下程序includeint f(intx){inty; if(x==0||x==1)return(3); y=x*x-f(x-2); return 有以下程序 #include <stdio.h> int f(int x) { int y; if(x==0||x==1) return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3); printf("%d\n",z); } 程序的运行结果是A.0B.9C.6D.8

考题 下列程序执行之后,将输出 public class exl9 { public static void main(string[] args) { int x=3; int y=7; switch(y/x){ case 1: y*=2; break; case 2: y*=3; break; case 3: y*=4; break; default: y=0; } System.out.print(y); } }A.28B.21C.14D.0

考题 请阅读以下程序 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; } cout<<"a="<<a<<"b="<<bend1; } 上面程序的输出结果是A.a=2, b=1B.a=1, b=1C.a=1. b=0D.a=2. b=2

考题 有下列程序: include main() {int a=6,b=7,m=1; switch(a%2) {case 0:m++;break; cas 有下列程序:#include<stdio.h>main(){ int a=6,b=7,m=1;switch(a%2){ case 0:m++;break;case 1:m++;switch(b%2){ defaut:m++;case0:m++;break;}}printf("%d\n",m);}程序运行后的输出结果是( )。A.1B.2C.3D.4

考题 有以下程序: include main() {int a=6,b=7,m=1;switch(a%2){ case 0:m++;break;case 1 有以下程序: #include<stdio.h> main() { int a=6,b=7,m=1; switch(a%2) { case 0:m++;break; case 1 :m++; switch(b%2) { defaut:m++; case0:m++;break; } } printf("%d\n",m); }A.1B.2C.3D.4

考题 若有如下程序: main() { int k,x=0,y=0; for(k=0;k<=2;k++) switch(k) { case 0: X++; case 1: y++; case 2: X++;y++; } printf("%d,"d\n",x,y); } 则程序运行后的输出结果是( )。A.3,3B.2,2C.4,5D.2,3

考题 下列程序的输出结果是(). 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++;break; } printf("a=%d,b=%d/n",a,b); }A、a=1,b=0B、a=2,b=1C、a=1,b=1D、a=2,b=2

考题 单选题有以下程序#include 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,a,b);}程序的运行结果是(  )。A a=2,b=1B a=2,b=2C a=1,b=1D a=1,b=0