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

上传人:twoload295 文档编号:497452 上传时间:2018-11-28 格式:DOC 页数:6 大小:31KB
下载 相关 举报
[计算机类试卷]国家二级C++机试(操作题)模拟试卷368及答案与解析.doc_第1页
第1页 / 共6页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷368及答案与解析.doc_第2页
第2页 / 共6页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷368及答案与解析.doc_第3页
第3页 / 共6页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷368及答案与解析.doc_第4页
第4页 / 共6页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷368及答案与解析.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、国家二级 C+机试(操作题)模拟试卷 368及答案与解析 一、基本操作题 1 使用 VC6打开考生文件夹下的源程序文件 modil cpp,但该程序运行有问题,请改正 main函数中的错误,使程序的输出结果是: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 注意:不要改动 main函数,不能增行或删行,也不能更改程序的结构, 错误的语句在 *error*的下面。 #include #include void main() int a33=1, 2, 3, 4, 5, 6), 7, 8, 9); int*p, i; *error* p=a; for(i=0; i #in

2、clude #defime NUM 50 int ANUMNUM= 1 0, 1 3, 5 9, 7 0, 6, 2, 4 0, 8 9, 92, 9, 1 4, 5 5, 7 1, 1 1, 1 9, 7 9, 68, 8 3, 97, 1 0 1, 1 02, 1 0 0 0 1, 2 3, 4 5 ; bool isPrime(int n) if(n=1) return false; if(n=2) retumR true; for(int i=2; i C1as s Person public: *1* int i; for(i=0; sUserrNamei!=0; i+1 m Use

3、rNamei=sUserrNamei; *2* mold=nold; private: char m_UserName32; int m_old; *3* ; void fun(char*s, Person&personl, Person&person2) *4* if() for(int i=0; personl m UserNamei !=0; i+) si =personl m UserNamei; si+1=0; else for(int i=0; person2 m UserNamei!=0; i+) si =person2 m UserNamei; Si+1=0; void main() char S32; Person p1(“abc”, 20); Person p2(“def”, 3 0); fun(s, p1, p2); coutperson2 mOld) 【试题解析】 在 VC环境下打开程序,根据题干给出的几条功能要求,对程序中给出注释下的内容逐个补全或修改。从已定源程序的 main主函数开始入手,函数fun是输出年龄较大的姓名,类 Person记录了姓名和年龄。

展开阅读全文
相关资源
猜你喜欢
  • AECMA PREN 2267-009-2003 Aerospace Series Cables Electrical for General Purpose Operating Temperatures between -55 Degrees C and 260 Degrees C Part 009 DRA family single and multic.pdf AECMA PREN 2267-009-2003 Aerospace Series Cables Electrical for General Purpose Operating Temperatures between -55 Degrees C and 260 Degrees C Part 009 DRA family single and multic.pdf
  • AECMA PREN 2267-010-2003 Aerospace Series Cables Electrical for General Purpose Operating Temperatures between -55 Degrees C and 260 Degrees C Part 010 DR family single UV laser pr.pdf AECMA PREN 2267-010-2003 Aerospace Series Cables Electrical for General Purpose Operating Temperatures between -55 Degrees C and 260 Degrees C Part 010 DR family single UV laser pr.pdf
  • AECMA PREN 2267-1995 Aerospace Series Electrical Cables for General Purpose Operating Temperatures between -55 Degrees Celsius and +260 Degrees Celsius Edition P 2 [Refer To ASD-ST.pdf AECMA PREN 2267-1995 Aerospace Series Electrical Cables for General Purpose Operating Temperatures between -55 Degrees Celsius and +260 Degrees Celsius Edition P 2 [Refer To ASD-ST.pdf
  • AECMA PREN 2269-1984 Steel FE-PM13 S 1800 Less Than or Equal to Rm Less Than or Equal to 2000 MPa Bar and Wire for Fasteners De Less Than or Equal to 700 mm Aerospace Series Editio.pdf AECMA PREN 2269-1984 Steel FE-PM13 S 1800 Less Than or Equal to Rm Less Than or Equal to 2000 MPa Bar and Wire for Fasteners De Less Than or Equal to 700 mm Aerospace Series Editio.pdf
  • AECMA PREN 2270-1984 Steel FE-PM13 S 1550 Less Than or Equal to Rm Less Than or Equal to 1750 MPa Bar and Wire for Fasteners De Less Than or Equal to 70 mm Aerospace Series Edition.pdf AECMA PREN 2270-1984 Steel FE-PM13 S 1550 Less Than or Equal to Rm Less Than or Equal to 1750 MPa Bar and Wire for Fasteners De Less Than or Equal to 70 mm Aerospace Series Edition.pdf
  • AECMA PREN 2271-1979 Steel FE-PM13 S 1800 MPa Less Than or Equal to Rm Less Than or Equal to 2000 MPa Forgings De Less Than or Equal to 70 mm Aerospace Series Edition 1《航空航天系列.钢FE-.pdf AECMA PREN 2271-1979 Steel FE-PM13 S 1800 MPa Less Than or Equal to Rm Less Than or Equal to 2000 MPa Forgings De Less Than or Equal to 70 mm Aerospace Series Edition 1《航空航天系列.钢FE-.pdf
  • AECMA PREN 2272-1979 Steel FE-PM13 S 1550 MPa Less Than or Equal to Rm Less Than or Equal to 1750 MPa Forgings De Less Than or Equal to 70 mm Aerospace Series Edition 1《航空航天系列.钢FE-.pdf AECMA PREN 2272-1979 Steel FE-PM13 S 1550 MPa Less Than or Equal to Rm Less Than or Equal to 1750 MPa Forgings De Less Than or Equal to 70 mm Aerospace Series Edition 1《航空航天系列.钢FE-.pdf
  • AECMA PREN 2273-1979 Steel FE-PM13 S 1800 MPa Less Than or Equal to Rm Less Than or Equal to 2000 MPa Sheet and Plate a Less Than or Equal to 30 mm Aerospace Series Edition 1《航空航天系.pdf AECMA PREN 2273-1979 Steel FE-PM13 S 1800 MPa Less Than or Equal to Rm Less Than or Equal to 2000 MPa Sheet and Plate a Less Than or Equal to 30 mm Aerospace Series Edition 1《航空航天系.pdf
  • AECMA PREN 2274-1979 Steel FE-PA95 1750 MPa Less Than or Equal to Rm Less Than or Equal to 2000 MPa Bars De Less Than or Equal to 150 mm Aerospace Series Edition 1《航空航天系列.钢 FE-PA95.pdf AECMA PREN 2274-1979 Steel FE-PA95 1750 MPa Less Than or Equal to Rm Less Than or Equal to 2000 MPa Bars De Less Than or Equal to 150 mm Aerospace Series Edition 1《航空航天系列.钢 FE-PA95.pdf
  • 相关搜索

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

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