【计算机类职业资格】三级网络技术机试-71及答案解析.doc

上传人:amazingpat195 文档编号:1321994 上传时间:2019-10-17 格式:DOC 页数:3 大小:27.50KB
下载 相关 举报
【计算机类职业资格】三级网络技术机试-71及答案解析.doc_第1页
第1页 / 共3页
【计算机类职业资格】三级网络技术机试-71及答案解析.doc_第2页
第2页 / 共3页
【计算机类职业资格】三级网络技术机试-71及答案解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、三级网络技术机试-71 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.某级数的前两项 A1=1,A 2=1,以后各项具有如下关系:An=An-2+2An-1下列程序的功能是:要求依次对于整数 M=100,1000 和 10000求出对应的 n值,使其满足:S nM 且Sn+1M,这里 Sn=A1+A2+An,并依次把 n值存入数组单元 b0,b1,b2中,请编制 jsValue()函数来实现此功能,最后调用函数 writeDar()把数组 b的值输出到 out48.dat文件中。注意:部分源程序已给出。请勿改动主函数 main()和输出函

2、数 writeDat()的内容。试题程序:#includestdio. hint b3;jsValue ( )main ( )jsValue( );printf( “M=100, n=%d/nM=1000, n=%d/nM=10000, n=%d/n“,b0,b1,b2);writeDat ();writeDat ()FILE *fp;fp=fopen (“out48.dat“, “w“);fprintf(fp,“%d/n%d/n%d/n“,b0,b1,b2);fclose (fp);(分数:100.00)_三级网络技术机试-71 答案解析(总分:100.00,做题时间:90 分钟)一、上机题

3、总题数:1,分数:100.00)1.某级数的前两项 A1=1,A 2=1,以后各项具有如下关系:An=An-2+2An-1下列程序的功能是:要求依次对于整数 M=100,1000 和 10000求出对应的 n值,使其满足:S nM 且Sn+1M,这里 Sn=A1+A2+An,并依次把 n值存入数组单元 b0,b1,b2中,请编制 jsValue()函数来实现此功能,最后调用函数 writeDar()把数组 b的值输出到 out48.dat文件中。注意:部分源程序已给出。请勿改动主函数 main()和输出函数 writeDat()的内容。试题程序:#includestdio. hint b3;

4、jsValue ( )main ( )jsValue( );printf( “M=100, n=%d/nM=1000, n=%d/nM=10000, n=%d/n“,b0,b1,b2);writeDat ();writeDat ()FILE *fp;fp=fopen (“out48.dat“, “w“);fprintf(fp,“%d/n%d/n%d/n“,b0,b1,b2);fclose (fp);(分数:100.00)_正确答案:(jsValue ( ) int al=1, a2=1, n=1, an;int sum0, sum;sum0=a1+a2;while (1) an=al+a2*2

5、 /*求下一个级数*/Sum=s umO +an; /*求级数和*/a1=a2; /*将 a2赋给 a1*/a2=an; /*将 an赋给 a2* /n+;if(sumo100 /*则将 n存入数组单元 b0中*/if(sumol000 /*则将 n存入数组单元 b1中*/if(sumol0000 /*则将 n存入数组单元 b2中*/break; /*并强行退出循环*/sumo=sum; /*将 sum赋给 sum0,为下一次循环的求和作准备*/)解析:解析本题考查的知识点如下:(1)利用循环和判断求级数。(2)循环的强行退出。(3)多个条件的“与”运算。由级数的表达式可以看出,级数中的各项可以由循环依次求得。当级数的和达到要求的条件时就可以退出循环结构。因为退出循环的两个条件 SnM,S n+1M 要同时满足,所以两条件之间要用到“与”运算。这里使用 break退出整个循环结构。

展开阅读全文
相关资源
猜你喜欢
  • DIN 51562-3-1985 Viscometry determination of kinematic viscosity using the Ubbelohde viscometer viscosity relative increment at short flow times《粘度测定法 用Ubberlohde粘度计测量动粘滞度 在短流动时间内相.pdf DIN 51562-3-1985 Viscometry determination of kinematic viscosity using the Ubbelohde viscometer viscosity relative increment at short flow times《粘度测定法 用Ubberlohde粘度计测量动粘滞度 在短流动时间内相.pdf
  • DIN 51562-4-1999 Viscometry - Measurement of kinematic viscosity by means of the Ubbelohde viscometer - Part 4 Viscometer calibration and determination of the uncertainty of measur.pdf DIN 51562-4-1999 Viscometry - Measurement of kinematic viscosity by means of the Ubbelohde viscometer - Part 4 Viscometer calibration and determination of the uncertainty of measur.pdf
  • DIN 51563-2011 Testing of Mineral Oils and Related Materials - Determination of Viscosity Temperature Relation - Slope m《矿物油和相关物质的检验 粘度和温度比的测定 斜率m》.pdf DIN 51563-2011 Testing of Mineral Oils and Related Materials - Determination of Viscosity Temperature Relation - Slope m《矿物油和相关物质的检验 粘度和温度比的测定 斜率m》.pdf
  • DIN 5157-2011 Sets of taps - Sets of 2 taps for pipe threads G 1 16 to G 4 and Rp 1 16 to Rp 4《成套丝锥-G1 16至G4和Rp1 16至Rp4管螺纹用二套件丝锥》.pdf DIN 5157-2011 Sets of taps - Sets of 2 taps for pipe threads G 1 16 to G 4 and Rp 1 16 to Rp 4《成套丝锥-G1 16至G4和Rp1 16至Rp4管螺纹用二套件丝锥》.pdf
  • DIN 51574-2017 Testing of lubricants - Sampling of lubricating oils from internal combustion engines《润滑剂检验 内燃机润滑油取样》.pdf DIN 51574-2017 Testing of lubricants - Sampling of lubricating oils from internal combustion engines《润滑剂检验 内燃机润滑油取样》.pdf
  • DIN 51575-2016 Testing of mineral oils - Determination of sulfated ash《矿物油的检验 硫酸盐灰分的测定》.pdf DIN 51575-2016 Testing of mineral oils - Determination of sulfated ash《矿物油的检验 硫酸盐灰分的测定》.pdf
  • DIN 51576-2003 Testing of mineral oil hydrocarbons - Determination of salt content《矿物油碳氢化合物的测试 盐含量的测定》.pdf DIN 51576-2003 Testing of mineral oil hydrocarbons - Determination of salt content《矿物油碳氢化合物的测试 盐含量的测定》.pdf
  • DIN 51577-4-1994 Testing of mineral oil hydrocarbons and similar products determination of chlorine and bromine content analysis by energy dispersive X-ray spectrometry with low co.pdf DIN 51577-4-1994 Testing of mineral oil hydrocarbons and similar products determination of chlorine and bromine content analysis by energy dispersive X-ray spectrometry with low co.pdf
  • DIN 51579-2010 Testing of paraffin - Determination of needle penetration《石腊检验 针入法测定》.pdf DIN 51579-2010 Testing of paraffin - Determination of needle penetration《石腊检验 针入法测定》.pdf
  • 相关搜索

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

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