一栋大楼内各办公室中的微机进行联网,这个网络属于()。
A.WAN
B.LAN
C.MAN
D.GAN
第1题
下列程序的执行结果为【15】。
#include(iostream. h>
void main()
{
Cout.fill(’*’);
cout. width(10);
cout <<”hello”<
}
第2题
下列程序的运行结果为【 】。
include <iostream. h>
class myclass
{
private:
int a, b, c;
public:
void fun()
{
int a;
a=10;
this->,a=5;
b=6;
this->c=7;
cout<<"a="<<a<<",this->a="<<this->a<<endl;
}
};
void main()
{
myclass obj1;
obj1.fun()
}
第3题
分析以下程序的执行结果【 】。
include <iostream. h>
class S{
int A[10];
public:
int &operator () (int);
};
int &S: :operator() (int x) {
return A[x];
}
void main() {
S a;
int i,j;
for (i=0; i<10; i++)
a(i)=i*2;
for (i=0; i<10; i++)
cout<<a(i)<<" ";
cout<<end1; }
第4题
下列程序的执行结果是【 】。
include <iostream. h>
int a;
int sum_a(void)
{
a=a+5;
return a;
}
void main(void)
{
a = a+sum_a();
cout<<a<<endl;
}
第5题
下列程序的运行结果是【 】。
include <iostream. h>
class A
{
int a, b;
public:
A() {a=b=0;}
A(int aa, int bb)
{
a=aa; b=bb;
cout<<a<<''<<b<<end1;
}
};
void main()
{ A x, y(2,3),z(4,5); }
第6题
下列程序的输出结果为【 】。
include <iostream. h>
void main()
{
char a[]="abcdabcabfgacd";
int i1=0,i2=0,i=0;
while (a[i])
{
if (a[i]=='a') i1++;
if (a[i]=='q') i2++;
i++;
}
cout<<i1<<''<<i2<<end1;
}
第7题
A.1234
B.1324
C.1342
D.3142
第8题
下列程序的执行结果是【 】。
include < iostream. h>
class Myclass
{
public:
void GetSum(int a)
static int Sum:
private:
int A;
};
int Myclass:: Sum =10; //必须在类外部对静态数据成员初始化
void Myelass: :GetSum(int a)
{
A=a;
Sum+=A;
}
void PrintSum(Myclass& A)
{
cout<<"Sum="<<A.Sum<<end1;
}
void main()
{
Myclass M,N;
M. GetSum(3)
N. GetSum(7)
PrintSum(M);
}
第9题
以下程序的执行结果是【 】。
include<iostream. h>
class Sample
{
public:
int x:
int y;
void disp()
{
cout<<"x="<<x<<",y="<<y<<end1;
}
};
void main()
{
int Sample:: ** pc;
Sample s;
pc=& Sample: :x;
s.*pc=10;
pc:=&Sample: :y;
s.*pc=20;
s.disp();
}
第10题
下列程序的运行结果是【 】。
include <iostream. h>
class test
{
private:
int num;
public:
test()
int TEST() {return num+100;}
~test()
};
test::test(){num=0;}
test::~test(){cout<<"Destructor is active"<<endl;}
void main()
{
test x[3]
cout<<x[1]. TEST()<<endl;
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!