单选题有如下程序: int x=3: d0 x-=2: cout<<x: while(!(--x)); 执行这个程序的输出结果是 A) 1 B) 30 C) 12 D) 死循环
单选题有如下类定义: class Test { public: Test(){a=0;c=0;} ∥① int f(int a) bonst{this->a=a;} //② static int g (){return a;} //③ void h(int b){Test::b=b;}; //④ private: int a; static int b: const int c; }; int Test::b=0; 在标注号码的行中,能被正确编译的是( )。
单选题若有以下程序:# include <iostream>using namespace std;class Basepublic: Base ( ) x=0; int x;;class Derived1 : virtual public Basepublic: Derived1 ( ) x=10; ; class Derived2 : virtual public Basepublic: Derived2 () x=20; ;class Derived : public Derived1,protected Derived2 ;int main() Derived obj; cout<<obj.x<<end1; return 0; 该程序运行后的输出结果是
单选题若有以下程序: #include<iostream> using namespace std; int f() { static int i=O; int s=1; s+=i; i++; return s; } int main() { int i,a=0; for(i=0;i<5;i++) a+=f(); cout<<a<<endl; retrun 0; } 程序运行后,输出的结果是
单选题有如下程序:
#include
using namespace std;
class B{
public:
virtual void show(){coutshow();}
void fun2(B&ref){ref.show();}
void fun3(B b){b.show();}
int main()
{
B b,*p=new D:
D d;
fun1(p);
fun2(b);
fun3(d);
delete p;
return 0;
}
执行这个程序的输出结果是( )。
单选题下面属于黑盒测试方法的是______。
单选题在深度为5的满二叉树中,叶子节点的个数为
单选题下面程序的运行结果是( )。 #include <iostream.h> class Sample int x,y; public: Sample() x=y=0; Sample(int a,int b) x=a;y=b; void disp() cout<<"x="<<x<<",y="<<y<<endl; ; void main() Sample s(2,3), *p= p->disp(); A.x=1,y=2 B.x=2,y=4 C.x=2,y=3 D.x=4,y=3
单选题有三个关系R,S和T如下:其中关系T由关系R和S通过某种操作得到,该操作为()。
单选题有以下程序: #include <iostream> #include <math> using namespace std; class point { private: double x; double y; public: point(double a,double b) { x=a; y=b; } friend double distance(point a,point b) ; }; double distance(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 pl(1,2); point p2 (5, 2); cout<<distance (pl,p2) <<end1; return 0; } 程序运行后的输出结果是( )。
单选题关于纯虚函数,下列表述中正确的是______。
单选题若有如下类声明:
class MyClass {
public:
MyClass() {cout<<1;}
};
执行下列语句
MyClass a, b[2], *p[2];
程序的输出结果是______。
单选题以下选项中合法的用户标识符是
____
。
单选题下列对列的叙述中,正确的是
单选题有两个关系R和S如下:由关系R得到关系S的操作是( )。
单选题支持子程序调用的数据结构是( )。
单选题以下函数声明中,存在语法错误的是______ 。
单选题由于常对象不能被更新,因此( )。
单选题有下列程序: #include<stdio.h> void main() char *a[]="abcd","ef","gh","ijk");int i; for(i=0;i<4;i++)printf("%c",*a[i]); 程序运行后的输出结果是( )。
单选题语句cout<<setprecison(3)<<3.1415926<<endl;的输出为( )。 A.3.14 B.3.1 C.3.142 D.3.141