[计算机类试卷]国家二级(C++)机试模拟试卷62及答案与解析.doc
《[计算机类试卷]国家二级(C++)机试模拟试卷62及答案与解析.doc》由会员分享,可在线阅读,更多相关《[计算机类试卷]国家二级(C++)机试模拟试卷62及答案与解析.doc(31页珍藏版)》请在麦多课文档分享上搜索。
1、国家二级( C+)机试模拟试卷 62及答案与解析 一、选择题 1 有三个关系 R、 S和 T如下:由关系 R和 S通过运算得到关系 T,则所使用的运算为 ( )。 ( A)笛卡尔积 ( B)交 ( C)并 ( D)自然连接 2 有如下程序: #include using namespace std; class A public: static int a; void init() a = 1; A(int a = 2) init(); a+; ; int A:a = 0; A obj; int main() cout #include using namespace std; int mai
2、n( ) cout using namespace std; void fun(int x=y/4; x+; int main() int x=4,y=5; fun(x,y); cout using namespace std; class AA char c; public: AA(char ch):c(ch) cout using namespace std; void fun(int c=a; a=b; b=c; int main() int x,y; x=1; y=2; fun(x,y); cout using namespace std; class AA char c; publi
3、c: AA(char ch):c(ch) AA() cout #include using namespace std; class Appliance public: Appliance(string t=“A“):type(t) cout using namespace std; class AA public: AA() cout using namespace std; class Base1 public: Base1() Base1() cout using namespace std; class Base public: void fun() coutfun(); ( D) f
4、un(); 34 算法的空间复杂度是指 ( )。 ( A)算法在执行过程中所需要的计算机存储空间 ( B)算法所处理的数据量 ( C)算法程序中的语句或指令条数 ( D)算法在执行过程中所需要的临时工作单元数 35 已知 Value是一个类, value是 Value的一个对象。下列以非成员函数形式重载的运算符函数原型中,正确的是 ( )。 ( A) Valueoperator+(Valuev,inti); ( B) Valueoperator+(Valuev=value,inti); ( C) Valueoperator+(Valuev,inti=0); ( D) Valueoperator
5、+(Valuev=value,inti=0); 36 要利用 C+流实现输入输出的各种格式控制,必须在程序中包含的头文件是 ( A) fstream ( B) istream ( C) ostream ( D) iomanip 37 通过运算符重载,可以改变运算符原有的 ( A)优先级 ( B)结合性 ( C)操作数类型 ( D)操作数个数 38 有如下程 序: #include #include using namespace std; class Appliance public: Appliance(string t=“A“):type(t) Appliance() cout using
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 试卷 国家 二级 模拟 62 答案 解析 DOC
