【计算机类职业资格】国家二级C++机试(操作题)模拟试卷388及答案解析.doc

上传人:tireattitude366 文档编号:1331886 上传时间:2019-10-17 格式:DOC 页数:3 大小:33KB
下载 相关 举报
【计算机类职业资格】国家二级C++机试(操作题)模拟试卷388及答案解析.doc_第1页
第1页 / 共3页
【计算机类职业资格】国家二级C++机试(操作题)模拟试卷388及答案解析.doc_第2页
第2页 / 共3页
【计算机类职业资格】国家二级C++机试(操作题)模拟试卷388及答案解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级 C+机试(操作题)模拟试卷 388及答案解析(总分:6.00,做题时间:90 分钟)一、基本操作题(总题数:1,分数:2.00)1.使用 VC6打开考生文件夹下的源程序文件 modilcpp,但该程序运行时有错,请改正程序中的错误,使程序输出的结果为: 1 0 注意:错误的语句在*error*的下面,修改该语句即可。 #include struct Struct union int a; char C4; ; int b; *error* void mein() Struct m; *error* mc0=0; mc1=0; mc2=0; *error* mc3=1; mb=mc3;

2、 coutdata=data; this 一next=NULL; , int data; TestClass* mext; , void Insert(TestClass*P,int data) TestClass*temp=new TestClass(data); TeStClass*pparent=p; TeStClass*pNext=p 一next; while(pNext) if(datapNext一data) *1* temp 一next=pNext; return; E1se f pParent=pNext; *2* if(pNext=NULL) pParent 一next=tem

3、p; retuen; void printf(TestClass*P) *3* while() coutdatadata; if(data=0)break; Insert(&head,data); while(1); printf(&head); Delete(&head); return; (分数:2.00)_国家二级 C+机试(操作题)模拟试卷 388答案解析(总分:6.00,做题时间:90 分钟)一、基本操作题(总题数:1,分数:2.00)1.使用 VC6打开考生文件夹下的源程序文件 modilcpp,但该程序运行时有错,请改正程序中的错误,使程序输出的结果为: 1 0 注意:错误的语句

4、在*error*的下面,修改该语句即可。 #include struct Struct union int a; char C4; ; int b; *error* void mein() Struct m; *error* mc0=0; mc1=0; mc2=0; *error* mc3=1; mb=mc3; coutdata=data; this 一next=NULL; , int data; TestClass* mext; , void Insert(TestClass*P,int data) TestClass*temp=new TestClass(data); TeStClass*

5、pparent=p; TeStClass*pNext=p 一next; while(pNext) if(datapNext一data) *1* temp 一next=pNext; return; E1se f pParent=pNext; *2* if(pNext=NULL) pParent 一next=temp; retuen; void printf(TestClass*P) *3* while() coutdatadata; if(data=0)break; Insert(&head,data); while(1); printf(&head); Delete(&head); return; (分数:2.00)_正确答案:(正确答案:(1)添加语句:pParent-next=temp; (2)添加语句:pNext=pNext 一next; (3)将“while()”补充完整为:while(p 一next!=NULL) (4)将“TestClass*templ=;”补充完整为:TestClasS*templ=p一next;)解析:解析:在 VC环境下打开程序,根据题干给出的几条功能要求,对程序中给出注释下的内容逐个补全或修改。从已给定源程序的 main主函数开始入手,可以看出程序通过调用类 TestClass实现各种输出操作。

展开阅读全文
相关资源
猜你喜欢
  • ISO 9851-1990 Continuous mechanical handling equipment overhead electrical monorail conveyors definitions and safety rules《连续搬运设备 电动单轨悬挂输送机 定义和安全规则》.pdf ISO 9851-1990 Continuous mechanical handling equipment overhead electrical monorail conveyors definitions and safety rules《连续搬运设备 电动单轨悬挂输送机 定义和安全规则》.pdf
  • ISO 9853-1991 Injection-moulded unplasticized poly(vinyl chloride) (PVC-U) fittings for pressure pipe systems crushing test《压力管道系统用硬聚氯乙烯(PVC-U)管件 扁平试验》.pdf ISO 9853-1991 Injection-moulded unplasticized poly(vinyl chloride) (PVC-U) fittings for pressure pipe systems crushing test《压力管道系统用硬聚氯乙烯(PVC-U)管件 扁平试验》.pdf
  • ISO 9854-1-1994 Thermoplastics pipes for the transport of fluids - Determination of pendulum impact strength by the Charpy method - Part 1 General test method《流.pdf ISO 9854-1-1994 Thermoplastics pipes for the transport of fluids - Determination of pendulum impact strength by the Charpy method - Part 1 General test method《流.pdf
  • ISO 9854-2-1994 Thermoplastics pipes for the transport of fluids - Determination of pendulum impact strength by the Charpy method - Part 2 Test conditions for p.pdf ISO 9854-2-1994 Thermoplastics pipes for the transport of fluids - Determination of pendulum impact strength by the Charpy method - Part 2 Test conditions for p.pdf
  • ISO 9855-1993 Ambient air determination of the particulate lead content of aerosols collected on filters atomic absorption spectrometric method《环境空气 滤器上采集的铅颗粒的测.pdf ISO 9855-1993 Ambient air determination of the particulate lead content of aerosols collected on filters atomic absorption spectrometric method《环境空气 滤器上采集的铅颗粒的测.pdf
  • ISO 9866-1-1991 Textiles effect of dry heat on fabrics under low pressure part 1 procedure for dry-heat treatment of fabrics《纺织品 织物在低压下的干热效应 第1部分 织物干热处理程序》.pdf ISO 9866-1-1991 Textiles effect of dry heat on fabrics under low pressure part 1 procedure for dry-heat treatment of fabrics《纺织品 织物在低压下的干热效应 第1部分 织物干热处理程序》.pdf
  • ISO 9866-2-1991 Textiles effect of dry heat on fabrics under low pressure part 2 determination of dimensional change in fabrics exposed to dry heat《纺织品 织物在低压下的干.pdf ISO 9866-2-1991 Textiles effect of dry heat on fabrics under low pressure part 2 determination of dimensional change in fabrics exposed to dry heat《纺织品 织物在低压下的干.pdf
  • ISO 9867-2009 Textiles - Evaluation of the wrinkle recovery of fabrics - Appearance method《纺织品 面料折皱回复度的评价 表观法》.pdf ISO 9867-2009 Textiles - Evaluation of the wrinkle recovery of fabrics - Appearance method《纺织品 面料折皱回复度的评价 表观法》.pdf
  • ISO 9874 CORR 1-2007 Milk - Determination of total phosphorus content - Method using molecular absorption spectrometry Technical Corrigendum 1《牛奶 总磷含量的测定 用分子吸收光.pdf ISO 9874 CORR 1-2007 Milk - Determination of total phosphorus content - Method using molecular absorption spectrometry Technical Corrigendum 1《牛奶 总磷含量的测定 用分子吸收光.pdf
  • 相关搜索

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

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