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

题目内容 (请给出正确答案)

下面程序段的运行结果是:()。 int a=1;b=2;c=2; while (a<b<c) {t=a;a=b;b=t;c--;} cout<<a<<”,”<<b<<”,”<<c;

A.1,2,0

B.2,1,0

C.1,2,1

D.2,1,1


参考答案和解析
1,2,1
更多 “下面程序段的运行结果是:()。 int a=1;b=2;c=2; while (a<b<c) {t=a;a=b;b=t;c--;} cout<<a<<”,”<<b<<”,”<<c;A.1,2,0B.2,1,0C.1,2,1D.2,1,1” 相关考题
考题 下面程序的运行结果是includevoid main( 0{ int num =1; int ref = num; ref= 下面程序的运行结果是 #include<iostream.h> void main( 0 { int num =1; int ref = num; ref=ref+2; cout << num; num = num+3; cout < < ref < < end1; }A.13B.16C.36D.33

考题 下面程序的运行结果是 include Void main( ) { int num=1; int ref=num;ref= 下面程序的运行结果是#include<iostream.h>Void main( ){int num=1;int ref=num;ref=ref+2;cout < < num;num=num+3;cout < < ref < <endl;}A.13B.16C.36D.33

考题 下面程序的运行结果是 include void fun(int * a,int * b) { int x= * a; * a= * 下面程序的运行结果是#include<iostream.h>void fun(int * a,int * b){int x= * a;* a= * b; * b=X;cout < < * a < < * b < <" ";}void main( ){int x=1,y=2;fun(x,y) ;cout < < X < < y < < endl;}A.12 12B.12 21C.21 12D.21 21

考题 下面程序的运行结果是#includevoid man ( ){int i=1;while(i =8)if(++i%3!=2)continue;else cout }A.25B.36C.258D.369

考题 下面程序段的运行结果是void main(){int t,a,b,c;a=1;b=2;c=2:while(a{t=a;a=b;b=t;c--;}cout }A.1,2,0B.2,1,0C.1,2,1D.2,1,1

考题 下面程序的运行结果是 include void main( ) { int i=1; while(i 下面程序的运行结果是#include<iostream.h>void main( ){int i=1;while(i <=8)if(++i%3!=2) continue;else cout < < i;}A.25B.36C.258D.369

考题 下列程序执行的结果是()。A=1;b=2;c=3;While(bac){t=a;a=b;b=t;c--;}printf(“%d,%d,%d”,a,b,c); A.1,2,0B.2,1,0C.1,2,1D.2,1,1

考题 下面程序段的运行结果是 void main() { int t,a,b,c; a=1;b=2;C=2; while(a<b<c) { t=a;a=b;b=t;c--;} cout << a << " ," << b << " ," << c; }A.1,2,0B.2,1,0C.1,2,1D.2,1,1

考题 若有以下程序: include using namespace std; template T min(T x,T y) {i 若有以下程序:include <iostream>using namespace std;template <class T>T min(T x,T y){if(x<y)return x;elsereturn y;}int main(){int n1=2,n2=10;double d1=1.5;d2=5.6;cout<<min(n1,n2)<<",";cout<<min(d2,d2)<<end1;return 0;}程序运行后的输出结果是【 】。

考题 下面程序的运行结果是( )。include define SlZE 12 main() {char s[SIZE];int i;for(i=0 下面程序的运行结果是( )。include<stdio.h>define SlZE 12main(){char s[SIZE];int i;for(i=0;i<SIZE;i++) s[i]='A'+i+32;sub(s,5,SIZE-1);for(i=0;i<SIZE;i++)printf("%c",s[i]);printf("\n");}sub(char *a,int t1,int t2){ char ch;while(t1<t2){ ch=*(a+t1);*(a+t1)=*(a+t2);*(a+t2)=ch;t1++;t2--;}}

考题 下面程序的运行结果是______。includemain(){ int y,a;y=2,a=1;while(y--!=-1){do{a*=y; 下面程序的运行结果是______。include<stdio.h>main(){ int y,a;y=2,a=1;while(y--!=-1){do{a*=y;a++;}while(y--);}printf("%d,%d",a,y);}

考题 下面程序的运行结果是()。includeclass base{protected:int a;public:base(){cout 下面程序的运行结果是( )。 #include<iostream.h> class base{ protected: int a; public: base(){cout<<“0”;} }; Class basel:Virtual base{ public: basel(){cout<<“1”;} }; Class base2:virtual base{ public: base2(){cout<<“2”;)A.0123B.3120C.0312D.3012

考题 下面程序的输出结果是()。includeusing namespace std;void swap(int x[2]){int t; t= 下面程序的输出结果是( )。 #include<iostream> using namespace std; void swap(int x[2]) { int t; t=x[0]; x[0]=x[1]; x[1]=t; } void main() { int a[2]={4,8}; swap(a); cout<<a[0]<<" "<<a[1]; }A.4 8B.8 4C.4 4D.8 8

考题 下面程序的结果是includeclass A{int a;public:A( ) :a(1) {}void showa ( ) {cout 下面程序的结果是 #include<iostream.h> class A { int a; public: A( ) :a(1) {} void showa ( ) {cout < < a;} }; class B { int a; public: B( ) :a(2) {} void showa( ) {cout < < a;} }; class C: public A, public B { t a; public: C( ) :a(3) {} void showa( ) {cout < < a;} }; void main( ) { C c; c.showa( ) ; }A.1B.2C.3D.程序有错误

考题 下面程序的运行结果是includeclass base{protected:int a;public:base( ){cout 下面程序的运行结果是 #include<iostream.h> class base{ protected: int a; public: base( ){cout<<"0";} }; class basel:virtual base { public: base1( ){cout<<"1";} }; class base2:virtual base{ public:A.123B.3120C.312D.3012

考题 下面程序的运行结果是( )。 include main() {int a,b,c,n; a=2;b=0;c=1;n=1; while(n 下面程序的运行结果是( )。 include<stdio.h> main() {int a,b,c,n; a=2;b=0;c=1;n=1; while(n<=3) {c=c*a;b=_b+c;++n;} printf("b=%d",B); }

考题 下面程序的运行结果是( )。define EXCH(a,B){int t;t=a;a=b;b=t;}main(){int x=1,y=2;EXCH(x,y);printf("x=%d,y=%d\n",x,y);}

考题 下面程序的运行结果是#include #define SIZE 12sub(char *a,int t1,int t2) { char ch; while(t1t2) { ch=*(a+t1); *(a+t1)=*(a+t2); *(a+t2)=ch; t1++;t2--; }} main() { char s[SIZE]={’A’,’B’,’C’,’D’,’E’,’F’,’G’,’H’,’I’,’J’,’K’,’L’}; int i; sub(s,7,SIZE-1); for(i=0;iSIZE;i++) printf("%c ",s[i]); printf("\n");}

考题 下面程序的结果是includeclass A { int a;public: A():a(1){} void showa(){cout 下面程序的结果是 #include<iostream.h> class A { int a; public: A():a(1){} void showa(){cout<<a;} }; class B { int a; public: B():a(2){} void showa(){cout<<a;} }; class C:public A,public B { int a; public: C():a(3) ㈠ voidshowa(){cout<<a;} }; voidmain() { C c; c.showa(); }A.1B.2C.3D.程序有错误

考题 下面程序的结果是includeclass A{int a;public:A( ):a(1){}void showa( ){cout 下面程序的结果是 #include<iostream.h> class A { int a; public: A( ):a(1){} void showa( ){cout<<a;} }; class B { int a; public: B( ) :a(2) {}A.1B.2C.3D.程序有错误

考题 下面程序的运行结果是【】。 include using namespace std; void fun(inta,int b=3) 下面程序的运行结果是【 】。include <iostream>using namespace std;void fun(int a, int b=3){static int i=2;a = a + b + i;i = i + a;}int main(){int x=5, y=2;fun(x, y);cout<<x<<",";fun(x);cout<<x<<end1;return 0;}

考题 下面程序的结果是()。includeclass A{int a;public:A():a(1){}void showa(){cout 下面程序的结果是( )。 #include<iostream.h> class A { int a; public: A():a(1){} void showa(){cout<<a;} }; Class B { int a; public: B():a(2){} void showa(){cout<<a;} ); class C:public A,public B { int a; puA.1B.2C.3D.程序有错误

考题 下面程序的输出结果是()。includeusing namespace std;templateT max(T x,T 下面程序的输出结果是( )。 #include<iostream> using namespace std; template<class T> T max(T x,T y) { return(x>= y ? x:y);} template<class T> T max(T x,T y,T z) { T t; t=(x>=y ? x:y); return(t>=z ? t:z); } void main(){ int x = 10,y=18,maxi; float a = 1.2,b = 3.2,c = 2,max2; max1 = max(x,(int)c); max2 = max(a,b,(float)y); cout<<maxi<<endl; cout<<max2<<endl;A.18 3.2B.10 18C.10 3.2D.编译出错

考题 下列程序段的执行结果是______。 int i=0; while(i++<=2) printf("%d\t",i);A.1 2 3B.1 2C.1D.无结果

考题 有如下程序段:int x=3,do{ x-=2;cout<<x;}while(!(--x));执行这个程序段的输出结果是( )。A.1B.30C.1-2D.死循环

考题 下面程序的运行结果是includevoid fun(int*a,int*b){int X= *a;* a= *b;*b=X;cout 下面程序的运行结果是 #include<iostream,h> void fun(int*a,int*b) { int X= *a; * a= *b; *b=X; cout<< *a<< *b<<" "; void main() int x=1, y=2; fun(x,y); cout<<X<<y<<end1; }A.12 12B.12 21C.21 12D.21 11

考题 下面程序的运行结果是includevoid main(){int num=1;int ref=num;ref=ref+2;c 下面程序的运行结果是 #include<iostream.h> void main() { int num=1; int ref=num; ref=ref+2; cout<<num; num=num+3; cout<<ref<<end1; }A.13B.16C.36D.33

考题 下面程序的运行结果是______。 include include fun(char*w,int n) { char 下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.7654321B.1714171C.1711717D.7177171