下面程序的运行结果为#include<iostream.h>void main(){for(int a =0,x=0;!x&&a<=10;a++){a++;}cout < < a < < endl;}
A.10
B.11
C.12
D.0
A.10
B.11
C.12
D.0
下面程序的运行结果为()。 #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<iostream.h>
void fun(int x=0,int y=0)
{
cout < < x < < y;
}
void main()
{
fun(5) ;
}
下面程序的运行结果为
#include
void main()
{
for(int a=0,x=0;!x&&a<=10;a++)
{
a++;
} l
cout<<
}
A.10
B.11
C.12
D. 0
下面程序的运行结果为()。#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
下面程序的运行结果为()。 #include <iostream> using namespace std; void main() { for(int a =0,x =0; !x&&a < =10; a ++ ); cout << a << endl;
A.0
B.1
C.10
D.11
A.2
B.3
C.4
D.5
阅读下列程序,则运行结果为 #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
A.5
B.6
C.7
D.8