下面程序的运行结果为#include<iostream. h>class A{public:A() {cout < <"1";}~A() {cout < <"2";}};class B:public A{public:B() {cout < <"3";}~B() {cout < <"4";}};void main(){B b;}
A.1234
B.1324
C.1342
D.3142
A.1234
B.1324
C.1342
D.3142
下面程序的运行结果为()。 #include<iostream.h> class A { int hum; public: A(int i){nuln=i;} A(A&A.{num=a.num十+;} void print{eout(<hum;} }; void main A a(1),b(A.; a.print; A print;
A.11
B.12
C.21
D.22
下面程序的运算结果为 ()。 #include < iostream > using namespace ~td; int i; int fun() { static int i = 10; return + + i; void main () { fun(); cout <<fun() <<" ," <<i; }
A.10,100
B.12,100
C.12,12
D.11,100
下面程序的运行结果为()。 #include<iostream.h> voidmain() { chara=3: switch(a) { case3:cout<<"3"; case2:cout<<"2";break; default:cout<<"1"; } }
A.3
B.321
C.31
D.32
阅读下列程序,则运行结果为 #include"stdio.h" fun() { static int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d\n",x);}
A.5
B.6
C.7
D.8
下面程序的运行结果为
#include
void main()
{
for(int a=0,x=0;!x&&a<=10;a++)
{
a++;
} l
cout<<
}
A.10
B.11
C.12
D. 0
A.2
B.3
C.4
D.5
下面程序的运行结果为()。#include<iostream.h> voidswap(int&a,intb) { inttemp; temp=a++; a=b: b=temp: } voidmain() { inta=2,b=3; swap(a,b); cout<<a<<","<<b<<endl; }
A.2,3
B.3,2
C.2,2
D.3,3
A.10
B.11
C.12
D.0
下面程序的运行结果为()。 #include<iostream> using namespace std; void swap(int &a,int &b){ int temp; temp=a; a=b; b=temp; } void main(){ int a=2,b=3; swap(a,b); cout<<a<<"," <<b<<ENDL; }
A.2,3
B.3,2
C.2,2
D.3,3
A.5
B.6
C.7
D.8
A.5
B.6
C.7
D.8