【计算机类职业资格】国家计算机二级(C++)87及答案解析.doc

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

1、国家计算机二级(C+)87 及答案解析(总分:460.00,做题时间:120 分钟)一、选择题(每小题 2 分,共 70 分) 下列各(总题数:35,分数:70.00)1.有如下程序 #include #include using namespace std; int main() coutB.+ - + -C. = B.+ - + -C. = =1 或 0 , i)解析:本程序有两重 for 循环,外层 for 循环控制输出数据的行数,故第 -|_|-空填“=1”或“0”,内层循环控制每行输出的个数。在内层 for 循环中,用语句“x=(j-1)*4+ -|_|-;”控制输出方阵中的具体数据

2、 由于这些数据与其所在的行、列(j,i)有关系x=(j-1)*4+i,故此空填 i。44.用以下语句调用库函数 malloc,使字符指针 st 指向具有 11 个字节的动态存储空间,请填空。 st=(char*) 1; (分数:30.00)填空项 1:_ (正确答案:malloc(11)或 malloc(sizeof(char) * 11 ))解析:malloc 函数的参数可以是一个具体的常数,也可以是一个表达式。在本题中, 可以是 malloc(11),也可以借助于 sizeof 运算符来表示。 45.构造函数是和 1 同名的函数。(分数:30.00)填空项 1:_ (正确答案:类)解析:

3、C+语言中的构造函数就是在类中定义的和类名一样的函数。46.语句 cout /n还可表示为 1。(分数:30.00)填空项 1:_ (正确答案:cout end1;)解析:“/n”表示换行,end1 也可表示换行。end1 和“/n”可以通用。47.将一个函数声明为一个类的友元函数必须使用关键字 1。(分数:30.00)填空项 1:_ (正确答案:friend)解析:本题考核友元函数。定义友元函数的方式是在类定义中用关键字 friend 说明该函数,其格式为:friend类型友元函数名(参数表);48.在 c+语言的面向对象程序设计框架中, 1 是程序的基本组成单元。(分数:30.00)填空项 1:_ (正确答案:类)解析:C+语言面向对象程序设计的基本组成单元是 class,面向过程的程序设计的 基本组成单元是函数。

展开阅读全文
相关资源
猜你喜欢
  • DIN EN ISO 75-1-2013 Plastics - Determination of temperature of deflection under load - Part 1 General test method (ISO 75-1 2013) German version EN ISO 75-1 2013《塑料 载荷下挠曲温度的测定 第1部.pdf DIN EN ISO 75-1-2013 Plastics - Determination of temperature of deflection under load - Part 1 General test method (ISO 75-1 2013) German version EN ISO 75-1 2013《塑料 载荷下挠曲温度的测定 第1部.pdf
  • DIN EN ISO 75-2-2013 Plastics - Determination of temperature of deflection under load - Part 2 Plastics and ebonite (ISO 75-2 2013) German version EN ISO 75-2 2013《塑料 载荷下挠曲温度的测定 第2.pdf DIN EN ISO 75-2-2013 Plastics - Determination of temperature of deflection under load - Part 2 Plastics and ebonite (ISO 75-2 2013) German version EN ISO 75-2 2013《塑料 载荷下挠曲温度的测定 第2.pdf
  • DIN EN ISO 75-3-2004 Plastics - Determination of temperature of deflection under load - Part 3 High-strength thermosetting laminates and long-fibre-reinforced plastics (ISO 75-3 20.pdf DIN EN ISO 75-3-2004 Plastics - Determination of temperature of deflection under load - Part 3 High-strength thermosetting laminates and long-fibre-reinforced plastics (ISO 75-3 20.pdf
  • DIN EN ISO 7500-1 Bb 1-1999 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines verification and calibration of the .pdf DIN EN ISO 7500-1 Bb 1-1999 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines verification and calibration of the .pdf
  • DIN EN ISO 7500-1 Bb 2-1999 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines verification and calibration of the .pdf DIN EN ISO 7500-1 Bb 2-1999 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines verification and calibration of the .pdf
  • DIN EN ISO 7500-1 Bb 3-1999 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines verification and calibration of the .pdf DIN EN ISO 7500-1 Bb 3-1999 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines verification and calibration of the .pdf
  • DIN EN ISO 7500-1 Bb 4-2013 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines - Verification and calibration of th.pdf DIN EN ISO 7500-1 Bb 4-2013 Metallic materials - Verification of static uniaxial testing machines - Part 1 Tension compression testing machines - Verification and calibration of th.pdf
  • DIN EN ISO 7500-2-2007 Metallic materials - Verification of static uniaxial testing machines - Part 2 Tension creep testing machines - Verification of the applied force (ISO 7500-2.pdf DIN EN ISO 7500-2-2007 Metallic materials - Verification of static uniaxial testing machines - Part 2 Tension creep testing machines - Verification of the applied force (ISO 7500-2.pdf
  • DIN EN ISO 7536-1996 Petroleum products - Determination of oxidation stability of gasoline - Induction period method (ISO 7536 1994) German version EN ISO 7536 1996《石油产品 汽油耐氧化性测定 诱.pdf DIN EN ISO 7536-1996 Petroleum products - Determination of oxidation stability of gasoline - Induction period method (ISO 7536 1994) German version EN ISO 7536 1996《石油产品 汽油耐氧化性测定 诱.pdf
  • 相关搜索

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

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