单选题一个工作人员可使用多台计算机,而一台计算机被多个人使用,则实体工作人员与实体计算机之间的联系是( )。
单选题有如下类定义: class AA{ int a; public: AA(int n=0):a(n){} }; class BB :public AA{ public: BB(int x) __________ };其中划线处应填写的内容是
单选题有如下程序: #include<iostream> using namespace std; class Base{ public: virtual void Show(){cout<<'B';} }; class Derived:public Base{ public: void Show(){cout<<'D';} }; int main(){ Base*p1=new Derived; Derived*p2=new.Derived; p1->Show(); p2->Show(); delete p1; delete p2; return 0; } 运行这个程序的输出结果是( )。
单选题下列关于继承的描述中,错误的是( )。
单选题有以下程序 #include <iostream> using namespace std; class sample private: int x; public: sample(int a) x=a; friend double square(sample s); ; double square(sample s) return s.x*s.x; int main() sample s1 (20),s2(30); cout<<square(s2)<<end1; return 0; 执行结果是 A) 20 B) 30 C) 900 D) 400
单选题下列关于运算符重载的描述中,正确的是( )。
单选题执行完下列语句 int a,b,c= int* p= 后c指向 A) a B) b C) c D) 无效地址
单选题有如下程序: #inc1ude <iostream> using namespace std; c1ass Instrument{ public: virtual void Disp1ay()=0; }; c1ass Piano: public Instrument{ public: void Disp1ay(){/*函数体程序略*/) }; int main(){ Instrument s; Instrument *p=0; //*; return0; } 下列叙述中正确的是( )。
单选题函数定义为fun(int &i),变量定义n=100,则下面调用正确的是( )。 A) fun(20); B) fun(20+n); C) fun(n); D) fun(&n);
单选题执行以下程序时,输入一行字符串为“Thank you very much!”,程序的输出结果为______。
#include<iostream>
using namespace std;
int main(){
char a[100];
cin>>a;
cout<<a<<"/n";
return 0;}
单选题下列关于类模板的描述中,错误的是
____
。
单选题有如下程序:
#include
using namespace std;
class Point{
public:
Point(int xx=0,int yy=0):x(xx),y(yy) { }
void SetX(int xx) { x=xx; }
void SetY(int yy) { y=yy; }
private:
int x,y;
};
class Circle:public Point{
public:
Circle(int r):radius(r) { }
int GetRadius() { return radius; }
private:
void SetRadius(int r) { radius=r; }
int radius;
};
int main(){
Circle c1(5);
c1.SetX(1); //①
c1.SetY(2); //②
c1.SetRadius(10); //③
cout<
单选题有如下程序; #include<iostream> using namespace std; class DA int k; public: DA(int x=1):k(x) ~DA( )cout<<k; ; int main( ) DA d[]=DA(3),DA(3),DA(3); DA *p=new DA[2]; delete []p; return (); 这个程序的输出结果是( )。
单选题在下列字符中,不允许作为C++标识符的是______。
单选题C++对C语言作了很多改进,下列描述中,( )使得C++语言发生了质变,即从面向过程变成了面向对象。
单选题要定义整型数组x,使之包括初值为0的三个元素,下列语句中错误的是( )。
单选题有如下程序:
#include
#include
using namespace std;
class MyBag{
public:
MyBag(string br="ABC"):brand(br) { cout<
单选题下列选项合法的标识符是______。
单选题已知函数f的原型为: void f(int 变量x、y的定义是: int x;double y; 则下列调用该函数的语句中正确的是______。 A.f(x, B.f(x,y); C.f( D.f(
单选题希尔排序属于( )。 A.交换排序 B.归并排序 C.选择排序 D.插入排序
