[计算机类试卷]国家二级C++机试(操作题)模拟试卷312及答案与解析.doc
《[计算机类试卷]国家二级C++机试(操作题)模拟试卷312及答案与解析.doc》由会员分享,可在线阅读,更多相关《[计算机类试卷]国家二级C++机试(操作题)模拟试卷312及答案与解析.doc(6页珍藏版)》请在麦多课文档分享上搜索。
1、国家二级 C+机试(操作题)模拟试卷 312及答案与解析 一、基本操作题 1 使用 VC6打开考生文件夹下的源程序文件 modi1 cpp,该程序运行时有错,请改正其中的错误,使程序正确运行,并且使程序输出的结果为: CMyObject, in the construtor CMyObject, in the destrutor 注意:错误的语句在 *error*的下面,修改该语句即可。 #include class CMyObject *error* *error* CMyObjectcout #define MAX_N 10 int XXMAX_NMAX_N; int fun(int n)
2、 void main() int nj do coutn; if(n=1) break; while(1); for(int i=0; iXXij; cout #include #include Class TestClass public: TestClass(char*fileName) len=0; fstream infile; infile open(fileName, ios: in); char ch; *1* while() coutch; *2* infile Close(); void split() fstream outfile1; fstream outfile2;
3、outfilel open(“out1 txt“, ios: out); outfile2 open(“out2 txt“, ios: out); int i=0; for(i=0; ilen 2; i+) outfilelbufi; do *3* while(i!=len); outfile1 close(); outfile2 CioSe(); private: int len; char buf1024; ); void main() *4* TestClass Fsp(); Fsp split(); return; 国家二级 C+机试(操作题)模拟试卷 312答案与解析 一、基本操作题
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 试卷 国家 二级 机试 操作 模拟 312 答案 解析 DOC