选择题 有如下程序:
#include < iostream >
using namespaee std;
class Base1
{
public:
Base1(int d) { cout <<d; }
~Base1 () {}
};
class Base2
{
public:
Base2 ( int d) { cout << d;}
~Base2() {}
};
class Derived: public Base1, Base2
{
public:
Derived(int a, int b, int c, int d) :Base1(b), Base2(a), b1(d), b2(e) {}
private:
int b1;
int b2;
};
int main()
{
Derived d(1,2,3,4);
return 0;
}
执行这个程序的输出记过是 。
选择题 下面内容不属于使用软件开发工具好处的是 。
选择题若变量已正确定义为inL型,要通过语句“scanf('%d,%d',&a,&b,&c);”给a赋值1、给b赋值2、给c赋值3,以下输入形式中错误的是(代表一个空格符)______。A.1,2,3<回车>B.123<回车>C.1,2,3<回车>D.1.2.3<回车>
选择题 下列程序段中包含4个函数,其中具有隐含this指针的是 。
int funl();
class Test{
public:
int fun2();
friend int fun3();
static int fun4();
};
选择题 为了使类中的某个成员不能被类的对象通过成员操作符访问,则不能把该成员的访问权限定义为______。
选择题 下面程序的输出结果是______。
#include <iostream>
using namespace std;
void fun(int i);
int main()
{
int n=2;
fun(n);
return 0;
}
void fun(int i)
{
static int x=1;
int y=1;
if(i>0)
{
++x;
++y;
cout<<x<<''<<y;
fun(i-1);
}
}
选择题 下列程序的输出结果是
#include<iostream.h>
void main( )
{ double d=3.2;
int x,y;
x=1.2;
y=(x+3.8)/5.0;
cout < < y * d < < end1;}
选择题 下列对基类和派生类关系的描述中,错误的是 。
选择题 在学生管理的关系数据库中,存取一个学生信息的数据单位是______。
选择题 下列选项中正确的定义语句是______。
选择题 具有3个结点的二叉树有______
选择题 有下列程序:
# include <stdio.h>
void main()
{
int x=1,y=0,a=0,b=0;
switch(x)
fcase 1:
switch(y)
{
case 0;a++;break;
case 1:b++break;
}
case 2:a++;b++;break;
case 3:a++;b++;
}
printf('a=%d,b=%d\n',a,b);
}
程序的运行结果是______。
选择题 下面关于对象概念的描述中, 是错误的。
选择题 一个类的友元函数或友元类可以通过成员操作符访问该类的 。
选择题 下面关于虚函数的描述中正确的是 。
选择题 考虑下面的函数原型:
void testDefaulParam(int a, int b=7, char z='*');
下面的函数调用中,不合法的是______。
选择题 下列选项中,______不属于软件设计的基本原理。
选择题 下面程序的输出是
main()
{int x=100, a=10, b=20, ok1=5, ok2=0;
if(a<b)
if(b! =15)
if( ! ok1)
else
if(ok2) x= 10
x=-1
cout<<x<<end1;
}
选择题 下列叙述中错误的是 。
选择题 关于下列程序段的描述中,正确的是 。
#include<iostream.h>
int fun(int,int);
void main()
{
cout<<fun(1,2)<<endl;
}
int fun(int x,int y)
{
return x+y;
}
