[计算机类试卷]国家二级C++机试(操作题)模拟试卷355及答案与解析.doc

上传人:sofeeling205 文档编号:497438 上传时间:2018-11-28 格式:DOC 页数:5 大小:29KB
下载 相关 举报
[计算机类试卷]国家二级C++机试(操作题)模拟试卷355及答案与解析.doc_第1页
第1页 / 共5页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷355及答案与解析.doc_第2页
第2页 / 共5页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷355及答案与解析.doc_第3页
第3页 / 共5页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷355及答案与解析.doc_第4页
第4页 / 共5页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷355及答案与解析.doc_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级 C+机试(操作题)模拟试卷 355及答案与解析 一、基本操作题 1 使用 VC6打开考生文件夹下的源程序文件 modil cpp,该程序运行时有错,请改正其中的错误,使程序正确运行,并且使程序输出的结果为: CMyObject, in the construtor CMyObject, in the destrutor 注意:错误的语句在 *error*的下面,修改该语句即可。 #include class CMyObj ect *error* *error* CMyObj ectcout #defime M 2 #defime N 4 void fun(int aMN, int*s

2、um) void msin() int xMN=7, 6, 5, 2, 4, 2, 8, 3); int s; fun(x, s); cout class TestClass1 public: *1* ; class TestClass2: public TestClass1 public: void GetName() CoutGetName(); coutaij)k=:; 求得每一行的最小值 s+=aik; 最小值求和 *sum=s; 返回求和值 【试题解析】 (1)该程序功能是求二维数组每行元素中的最小值,并计算它们的和值。本题解题思路基本可以分为两重循环,外重循环为对二维数组的所有行进

3、行循环,内重循环为对每一行内进行列循环,求出每一行中的最小值。最后求出这些最小值的和。 (2)从己给部分源程序的 main主函数开始入手,核心函数 void fun(int aMN,int*sum)中的 a参数为二维数组, sum为要求得的和。 三、综合应用题 3 【正确答案】 (1)添加语句: virtual void GetName()=0; (2)添加语句: const char*GetName2() (3)添加语句: TestClass2(char*str) (4)添加语句: m stri=0; 【试题解析】 在 VC环境下打开程序,根据题干给出的几条功能要求,对程序中给出注释 下的内容逐个补全或修改。从已定源程序的 main主函数开始入手,可以看出程序通过调用类 TestClass和接口函数 Gemame实现各种输出操作。

展开阅读全文
相关资源
猜你喜欢
  • BS ISO 7967-6-2005 en_7668  Reciprocating internal combustion engines - Vocabulary of components and systems - Lubricating systems《往复式内燃机.零部件和系统词汇.润滑系统》.pdf BS ISO 7967-6-2005 en_7668 Reciprocating internal combustion engines - Vocabulary of components and systems - Lubricating systems《往复式内燃机.零部件和系统词汇.润滑系统》.pdf
  • BS ISO 7967-7-2005 en_6650  Reciprocating internal combustion engines - Vocabulary of components and systems - Governing systems《往复式内燃机.零部件和系统词汇.调节系统》.pdf BS ISO 7967-7-2005 en_6650 Reciprocating internal combustion engines - Vocabulary of components and systems - Governing systems《往复式内燃机.零部件和系统词汇.调节系统》.pdf
  • BS ISO 7967-8-2005 en_4261  Reciprocating internal combustion engines - Vocabulary of components and systems - Starting systems《往复式内燃机.零部件和系统词汇.起动系统》.pdf BS ISO 7967-8-2005 en_4261 Reciprocating internal combustion engines - Vocabulary of components and systems - Starting systems《往复式内燃机.零部件和系统词汇.起动系统》.pdf
  • BS ISO 7967-9-2010 en_2159  Reciprocating internal combustion engines - Vocabulary of components and systems - Control and monitoring systems《往复式内燃机.零部件和系统词汇.控制和监测系统》.pdf BS ISO 7967-9-2010 en_2159 Reciprocating internal combustion engines - Vocabulary of components and systems - Control and monitoring systems《往复式内燃机.零部件和系统词汇.控制和监测系统》.pdf
  • BS ISO 7970-2011 en_2392  Wheat (Triticum aestivum L.) Specification《小麦(Triticum aestivum L.)规范》.pdf BS ISO 7970-2011 en_2392 Wheat (Triticum aestivum L.) Specification《小麦(Triticum aestivum L.)规范》.pdf
  • BS ISO 799-2004 en_1516  Ships and marine technology - Pilot ladders《船舶和海上技术.领航员扶梯》.pdf BS ISO 799-2004 en_1516 Ships and marine technology - Pilot ladders《船舶和海上技术.领航员扶梯》.pdf
  • BS ISO 7992-2015 en_9819  Iron ores for blast furnace feedstocks Determination of reduction under load《鼓风炉给料用铁矿石.负荷还原性的测定》.pdf BS ISO 7992-2015 en_9819 Iron ores for blast furnace feedstocks Determination of reduction under load《鼓风炉给料用铁矿石.负荷还原性的测定》.pdf
  • BS ISO 8005-2006 en_1993  Carbonaceous materials used in the production of aluminium - Green and calcined coke - Determination of ash content《铝生产用碳素材料.生焦炭和煅烧焦炭.灰分含量的测定》.pdf BS ISO 8005-2006 en_1993 Carbonaceous materials used in the production of aluminium - Green and calcined coke - Determination of ash content《铝生产用碳素材料.生焦炭和煅烧焦炭.灰分含量的测定》.pdf
  • BS ISO 8007-3-2005 en_4794  Carbonaceous materials used in the production of aluminium - Sampling plans and sampling from individual units - Sidewall blocks《铝生产用碳素材料.单个材料的取样方案和取样.侧壁块》.pdf BS ISO 8007-3-2005 en_4794 Carbonaceous materials used in the production of aluminium - Sampling plans and sampling from individual units - Sidewall blocks《铝生产用碳素材料.单个材料的取样方案和取样.侧壁块》.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1