【计算机类职业资格】二级C++笔试-299及答案解析.doc

上传人:eastlab115 文档编号:1324538 上传时间:2019-10-17 格式:DOC 页数:30 大小:84.50KB
下载 相关 举报
【计算机类职业资格】二级C++笔试-299及答案解析.doc_第1页
第1页 / 共30页
【计算机类职业资格】二级C++笔试-299及答案解析.doc_第2页
第2页 / 共30页
【计算机类职业资格】二级C++笔试-299及答案解析.doc_第3页
第3页 / 共30页
【计算机类职业资格】二级C++笔试-299及答案解析.doc_第4页
第4页 / 共30页
【计算机类职业资格】二级C++笔试-299及答案解析.doc_第5页
第5页 / 共30页
点击查看更多>>
资源描述

1、二级 C+笔试-299 及答案解析(总分:100.00,做题时间:90 分钟)一、选择题(总题数:35,分数:70.00)1.执行语句:coutsetfill(*)setw(10)setfill(#)left123“OK“endl;后将输出(分数:2.00)A.123*OKB.123#OKC.123*OK*D.123#OK#2.有以下程序#includeiostreamusing namespace std;class MyClasspublic:MyClass(int n)number =n; /拷贝构造函数MyClass(MyClass”时,就会先调用虚基类 Base 的构造函数,使得 x

2、0,然后执行类 Derived1 的构造函数使得 x=10,再执行类 Derived2 的构造函数,使得 x=20。最后输出 x 的值为 20。50.下面程序的执行结果是_。#includeiostream.h#includeiomanip.husing namespace std;void main()coutsetfill(x)setw(10);cout“Hello“endl;(分数:2.00)填空项 1:_ (正确答案:xxxxxHello)解析:解析 本题考核 I/O 的格式化输出。setfill(x)表示填充字符为x,并且一直有效,直到再次设置填充字符为止。setw(10)表示将输入输出宽度设置为 10,当实际数据宽度小于指定的宽度时,多余的位置用填充字符填满;当实际数据的宽度大于设置的宽度时,仍按实际的宽度输出。宽度设置的效果只对一次输入或输出有效,在完成一个数据的输入或输出后,宽度设置自动恢复为 0(表示按数据实际宽度输入输出)。题中字符串“Hello”的宽度不够 10,所以其前面将有 5 个填充符 x。

展开阅读全文
相关资源
猜你喜欢
  • EN ISO 9377-2-2000 en Water quality - Determination of hydrocarbon oil index - Part 2 Method using solvent extraction and gas chromatography《水质 烃油指数的测定 第2部分 用溶剂萃取法和气相色谱法》.pdf EN ISO 9377-2-2000 en Water quality - Determination of hydrocarbon oil index - Part 2 Method using solvent extraction and gas chromatography《水质 烃油指数的测定 第2部分 用溶剂萃取法和气相色谱法》.pdf
  • EN ISO 9394-2012 en Ophthalmic optics - Contact lenses and contact lens care products - Determination of biocompatibility by ocular study with rabbit eyes《眼科光学 隐形眼镜和隐形眼镜护理产品 决心眼生物相.pdf EN ISO 9394-2012 en Ophthalmic optics - Contact lenses and contact lens care products - Determination of biocompatibility by ocular study with rabbit eyes《眼科光学 隐形眼镜和隐形眼镜护理产品 决心眼生物相.pdf
  • EN ISO 9396-2000 en Plastics - Phenolic Resins - Determination of the Gel Time at a Given Temperature Using Automatic Apparatus《塑料 酚醛树脂 用自动装置在给定温度下对凝胶时间的测定 ISO 9396-1997》.pdf EN ISO 9396-2000 en Plastics - Phenolic Resins - Determination of the Gel Time at a Given Temperature Using Automatic Apparatus《塑料 酚醛树脂 用自动装置在给定温度下对凝胶时间的测定 ISO 9396-1997》.pdf
  • EN ISO 9400-1995 en Nickel-Based Alloys - Determination of Resistance to Intergranular Corrosion《镍基合金 抗晶间腐蚀性测定(ISO 9400-1990)》.pdf EN ISO 9400-1995 en Nickel-Based Alloys - Determination of Resistance to Intergranular Corrosion《镍基合金 抗晶间腐蚀性测定(ISO 9400-1990)》.pdf
  • EN ISO 9405-2017 en Textile floor coverings - Assessment of changes in appearance.pdf EN ISO 9405-2017 en Textile floor coverings - Assessment of changes in appearance.pdf
  • EN ISO 9408-1999 en Water Quality - Evaluation of Ultimate Aerobic Biodegradability of Organic Compounds in Aqueous Medium by Determination of Oxygen Demand in a Closed Respiromete.pdf EN ISO 9408-1999 en Water Quality - Evaluation of Ultimate Aerobic Biodegradability of Organic Compounds in Aqueous Medium by Determination of Oxygen Demand in a Closed Respiromete.pdf
  • EN ISO 9409-1-2004 en Manipulating Industrial robots - Mechanical Interfaces - Part 1 Plates《操作型工业机器人 机械接口 第1部分 板 ISO 9409-1-2004》.pdf EN ISO 9409-1-2004 en Manipulating Industrial robots - Mechanical Interfaces - Part 1 Plates《操作型工业机器人 机械接口 第1部分 板 ISO 9409-1-2004》.pdf
  • EN ISO 9409-2-2003 en Manipulating industrial robots - Mechanical interfaces - Part 2 Shafts《操作型工业机器人 机械接口 第2部分 轴 ISO 9409-2-2002》.pdf EN ISO 9409-2-2003 en Manipulating industrial robots - Mechanical interfaces - Part 2 Shafts《操作型工业机器人 机械接口 第2部分 轴 ISO 9409-2-2002》.pdf
  • EN ISO 9431-1999 en Construction Drawings - Spaces for Drawing and for Text and Title Blocks on Drawing Sheets《建筑工程制图 图样说明纸和标题栏的位置 ISO 9431-1990》.pdf EN ISO 9431-1999 en Construction Drawings - Spaces for Drawing and for Text and Title Blocks on Drawing Sheets《建筑工程制图 图样说明纸和标题栏的位置 ISO 9431-1990》.pdf
  • 相关搜索

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

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