单选题下列语句中,错误的是______。
单选题语句cout <<setprecison (3)<<3.1415926<<end1;的输出为
____
。
单选题下述有关构造函数的说法,不正确的是( )。
单选题在名为 BigNumber 的类的类体中对运算符函数double进行了如下声明: operator double(BigNumber);函数声明中有一个明显的错误,这个错误就是
单选题有如下程序: #include<iostream> using
namespace std; class TestClass
{private: int x,y; public:
TestClass(int i,int j) {x=i; y=j;}
void print() {cout<<"print1"<<endl;}
void print() const (cout<< "print2"<<endl;});
int main() {const TestClass a(1,2):
a.print(); return 0;} 该程序运行后的输出结果是______。
A.print1
B.print2
C.print1 print2
D.程序编译时出错
单选题有如下说明:int a[10]={1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, *p=a;
则数值为9的表达式是______。
单选题在E—R图中,用来表示实体联系的图形是( )。
单选题有如下程序:
#include<iostream>
using namespace std;
class Publication{ //出版物类
char name[30];
public:
Publication(char *name="未知名称"){
strcpy(this->name,name);
}
const cha * getName()const{return name;}
virtual const char * getType()const{return"未知类型";}
};
class Book:public Publication{ //书类
public:
Book(char *name): Publication(name){}
virtual const char * getType()const{return"书";}
};
void showPublication(Publication
}
int main(){
Book book("精彩人生");
showPublication(book);
return 0;
}
运行时的输出结果是______。
单选题有如下程序
#include
using namespace std;
class Test{
public:
Test(){ }
Test(const Test }
};
Test fun(Test return t;}
int main(){Test x,y; x=fun(y); return 0;}
运行这个程序的输出结果是
单选题对于算法的每一步,指令必须是可执行的。算法的
____
要求算法在有限步骤之后能够达到预期的目的。
单选题对关系S和关系R进行集合运算,结果中既包含关系S中的所有元组也包含关系R中的所有元组,这样的集合运算称为( )。
单选题下列语句分别是不同程序中的第一个输入输出语句,若去掉其中的“<<left”,输出效果将发生变化的是( )。
单选题对虚函数的调用( )。
单选题为了避免嵌套的if…else语句的二义性,C++规定与else配对的是
单选题已知枚举类型定义语句为:
enum Tooken{NAME, NUMBER, PLUS=5, MINUS, PRINT=10};
则下列叙述错误的是______。
单选题模板对类型的参数化提供了很好的支持,因此( )。
单选题下列程序的运行结果是
#include<iostream.h>
class A
{
int a;
public:
A( ) {a=0;}
A(int aa)
{
a=aa;
cout < < a++;
}
};
void main( )
A x,y(2) ,z(3) ;
cout < < endl;
}
单选题有如下程序:
#include<iostream>
using namespace std;
class XX{
int x;
public:
XX(int xx=0):x(xx){}
int getX(){return x;}
};
class YY:public XX{
int y;
public:
YY(int xx, int yy):x(xx), y(yy){}
int getV(){return getX()+y;}
};
int main(){
YY c(3, 4);
cout<<c.getV()+c.getX()<<endl;
return 0;
}
运行这个程序的输出结果是______。
单选题若有以下程序: #include 〈iostream〉 using namespace std; class A { private: int x; public: int z; void setx(int i) { x=i; } int getx () { return x; } }; class B : public A { private: int m; public: int p; void setvalue(int a,int b, int C) { setx (A) ; z=b; m=c; } void display() { cout〈〈getx()〈〈","〈〈z〈〈","〈〈m〈〈end1; } }; int main ( ) { B obj; obj.setvalue(2,3,4); obj.display(); return 0; } 程序运行以后的输出结果是( )。
单选题下面程序的输出结果是( )。
#include
#include
using namespace std;
class point
{
private:
double x:
double y;
public:
point(double a,double b1
{ x=a;
y=b;
}
friend double distances(point a,point b);
};
double distances(point a,point b)
{
return
sqrt((a.X—b.x)*(a.x一b.x)+(a.y—b.y)*(a.y一b.y));
}
int main()
{point p1(1,2);
point p2(5,2);
cout<
