选择题 有以下程序:
void main()
{ int a=5,b=4,c=3,d=2;
if(a>b>c)
cout<<d<<end1;
else if((c-1)=d)==1)
cout<<d+1<<end1;
else
cout<<d+2<<end1;
}
选择题 对于算法的每一步,指令必须是可执行的。算法的 要求算法在有限步骤之后能够达到预期的目的。
选择题 已知类Myst有一个只需要一个double型参数的构造函数,且将运算符“-”重载为友元函数。要使语句序列
Myst x(3.2), y(5.5), z(0.0);
z=8.9-y;
y=x-6.3;
能够正常运行,运算符函数operator-应在类中声明为______。
选择题 下列关于输入流类成员函数getline()的描述中,错误的是______。
选择题 有如下程序:
#include<iostream>
using namespace std;
class Base{
int x;
public:
Base(int n=0):x(n){cout<<n;}
int getX()const{return x;}
};
class Derived:public Base{
mt y;
public:
Derived(int m,int n):y(m),Base(n){cout<<m;}
Derived(int m):y(m){cout<<m;}
};
int main()
{
Derived d1(3),d2(5,7);
return 0;
}
执行这个程序的输出结果是______。
选择题 在C++语言中,封装是借助于什么达到的?______
选择题 下列关于模版的叙述中,错误的是______。
选择题 层次型、网状型和关系型数据库划分原则是______。
选择题 下面的函数调用为:
fun(x+y,3,min(n-1,y))则fun的实参个数是______。
选择题 下列各类函数中,不是类的成员函数的是______
选择题 下列错误的定义语句是______。
选择题 下列关于运算符函数的叙述中,错误的是______。
选择题 在C++中,编译系统自动为一个类生成默认构造函数的条件是______。
选择题 有如下程序:
#include<iostream>
#include<cstring>
using namespace std;
class MyString{
public:
char str[80];
MyString(const char*s)
{strcpy(str,s);}
MyString operator+=(MyString a)
{strcat(str,a.str);
return*this;
}
};
ostream operator<<(ostream s,const MyString z){return s<<z.str;}
int main(){
MyString x('abc'),y('cde');
cout<<(x+=y)<<endl;
return 0;
}
运行这个程序的输出结果是______。
选择题 若有以下的定义,int a[ ]={1,2,3,4,5,6,7,8,9,10},*p=a;则值为3的表达式是 ______。
选择题 在三级模式之间引入两层映像,其主要功能之一是______。
选择题 在数据库的三级模式结构中,描述数据库中全体数据的全局逻辑结构和特征的是______。
选择题 当一个派生类对象结束其生命周期时,系统自动做的事情是______。
选择题 执行下列语句段后,输出字符“*”的个数是______。
for(int i=50; i>1; --i)
cout <<'*';
选择题 有如下程序:
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
cout<<setfill('#')<<setw(4)<<'OK'<<123<<endl;
return 0;
}
运行这个程序的输出结果是______。
