【计算机类职业资格】二级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。

展开阅读全文
相关资源
猜你喜欢
  • ITU-R F 1821 FRENCH-2007 Characteristics of advanced digital high frequency (HF) radiocommunication systems《高级数字高频(HF)无线通信系统的特性》.pdf ITU-R F 1821 FRENCH-2007 Characteristics of advanced digital high frequency (HF) radiocommunication systems《高级数字高频(HF)无线通信系统的特性》.pdf
  • ITU-R F 1821 SPANISH-2007 Characteristics of advanced digital high frequency (HF) radiocommunication systems《高级数字高频(HF)无线通信系统的特性》.pdf ITU-R F 1821 SPANISH-2007 Characteristics of advanced digital high frequency (HF) radiocommunication systems《高级数字高频(HF)无线通信系统的特性》.pdf
  • ITU-R F 1821-2007 Characteristics of advanced digital high frequency (HF) radiocommunication systems《高级数字高频(HF)无线通信系统的特性》.pdf ITU-R F 1821-2007 Characteristics of advanced digital high frequency (HF) radiocommunication systems《高级数字高频(HF)无线通信系统的特性》.pdf
  • ITU-R F 1891 FRENCH-2011 Technical and operational characteristics of gateway links in the fixed service using high altitude platform stations in the band 5 850-7 075 MHz to be use.pdf ITU-R F 1891 FRENCH-2011 Technical and operational characteristics of gateway links in the fixed service using high altitude platform stations in the band 5 850-7 075 MHz to be use.pdf
  • ITU-R F 1891 SPANISH-2011 Technical and operational characteristics of gateway links in the fixed service using high altitude platform stations in the band 5 850-7 075 MHz to be us.pdf ITU-R F 1891 SPANISH-2011 Technical and operational characteristics of gateway links in the fixed service using high altitude platform stations in the band 5 850-7 075 MHz to be us.pdf
  • ITU-R F 1891-2011 Technical and operational characteristics of gateway links in the fixed service using high altitude platform stations in the band 5 850-7 075 MHz to be used in sh.pdf ITU-R F 1891-2011 Technical and operational characteristics of gateway links in the fixed service using high altitude platform stations in the band 5 850-7 075 MHz to be used in sh.pdf
  • ITU-R F 2004-2012 Radio-frequency channel arrangements for fixed service systems operating in the 92-95 GHz range《92-95 GHz频率范围内固定业务系统的射频信道配置》.pdf ITU-R F 2004-2012 Radio-frequency channel arrangements for fixed service systems operating in the 92-95 GHz range《92-95 GHz频率范围内固定业务系统的射频信道配置》.pdf
  • ITU-R F 2005-2012 Radio-frequency channel and block arrangements for fixed wireless systems operating in the 42 GHz (40 5 to 43 5 GHz) band《工作在42 GHz(40 5-43 5 GHz)频段内的固定无线系统的射频信道和.pdf ITU-R F 2005-2012 Radio-frequency channel and block arrangements for fixed wireless systems operating in the 42 GHz (40 5 to 43 5 GHz) band《工作在42 GHz(40 5-43 5 GHz)频段内的固定无线系统的射频信道和.pdf
  • ITU-R F 2006-2012 Radio-frequency channel and block arrangements for fixed wireless systems operating in the 71-76 and 81-86 GHz bands《71-76和81-86 GHz频段范围内固定无线系统的射频信道和区配置》.pdf ITU-R F 2006-2012 Radio-frequency channel and block arrangements for fixed wireless systems operating in the 71-76 and 81-86 GHz bands《71-76和81-86 GHz频段范围内固定无线系统的射频信道和区配置》.pdf
  • 相关搜索

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

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