【计算机类职业资格】计算机三级网络技术机试(上机操作)-试卷1及答案解析.doc

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

1、计算机三级网络技术机试(上机操作)-试卷 1及答案解析(总分:2.00,做题时间:90 分钟)一、程序设计题(总题数:1,分数:2.00)1.已知数列 Xn的前两项为 2和 3,其后继项根据当前最后两项的乘积按下列规则生成;(1)若乘积为 1位数。则该乘积为数列的后继项;(2)若乘积为 2位数,则该乘积的十位数字和个位数字依次作为数列的两个后继项。 请编写函数 void produceX(int n),生成该数列的前 n项(n100),并把它保存在数组outBuf中,再把这前 100项的和保存在整型变量 sum中。readWriteData()函数负责将 n值从 INDAT 文件中读出,并将结

2、果 outBuf输出到文件 OUTDAT 中。 注意:部分源程序已经给出。 请勿改动主函数main()和输出函数 readWriteData()的内容。 试题程序: #include int outBuf200,sum=0; void readWriteData(); void produceX(int n) void main() int n,i; printf(“please input the amounts n:”); scanf(“d”,&n); produceX(n); for(i=0;i_计算机三级网络技术机试(上机操作)-试卷 1答案解析(总分:2.00,做题时间:90 分钟)

3、一、程序设计题(总题数:1,分数:2.00)1.已知数列 Xn的前两项为 2和 3,其后继项根据当前最后两项的乘积按下列规则生成;(1)若乘积为 1位数。则该乘积为数列的后继项;(2)若乘积为 2位数,则该乘积的十位数字和个位数字依次作为数列的两个后继项。 请编写函数 void produceX(int n),生成该数列的前 n项(n100),并把它保存在数组outBuf中,再把这前 100项的和保存在整型变量 sum中。readWriteData()函数负责将 n值从 INDAT 文件中读出,并将结果 outBuf输出到文件 OUTDAT 中。 注意:部分源程序已经给出。 请勿改动主函数ma

4、in()和输出函数 readWriteData()的内容。 试题程序: #include int outBuf200,sum=0; void readWriteData(); void produceX(int n) void main() int n,i; printf(“please input the amounts n:”); scanf(“d”,&n); produceX(n); for(i=0;i_正确答案:(正确答案:void produceX(int n) int i,X; outBuf0=2;outBuf1=3; for(i=2;in;i+) X=outBufi-1*outBufi-2; if(X10) 如果是两位数 outBufi=x10;求出十位上的值 sum+=outBufi; 将该数计入总和 i+; 将数组下标右移一位 outBufi=X10;求出个位上的值 sum+=outBufi; 将该数计入总和 else如果是一位数 outBuffi=X; sum+=outBufi; 将该数计人总和 )解析:解析:本题主要考查数列问题。按照指定的运算规则,如果得到的乘积是两位数,则将两位数的十住和个位作为新的后两位,注意此时循环量应谊多加 1。如果得到的是 1位数,直接作为新值即可。

展开阅读全文
相关资源
猜你喜欢
  • DIN EN 15495-2008 Non destructive testing - Acoustic emission - Examination of metallic pressure equipment during proof testing - Zone location of AE sources English version of DIN.pdf DIN EN 15495-2008 Non destructive testing - Acoustic emission - Examination of metallic pressure equipment during proof testing - Zone location of AE sources English version of DIN.pdf
  • DIN EN 15496-2008 Cycles - Requirements and test methods for cycle locks English version of DIN EN 15496 2008-04《自行车 自行车车锁的要求和试验方法》.pdf DIN EN 15496-2008 Cycles - Requirements and test methods for cycle locks English version of DIN EN 15496 2008-04《自行车 自行车车锁的要求和试验方法》.pdf
  • DIN EN 15497-2014 Structural finger jointed solid timber - Performance requirements and minimum production requirements German version EN 15497 2014《指接结构实木 性能要求和最低生产要求 德文版本EN 15497.pdf DIN EN 15497-2014 Structural finger jointed solid timber - Performance requirements and minimum production requirements German version EN 15497 2014《指接结构实木 性能要求和最低生产要求 德文版本EN 15497.pdf
  • DIN EN 15498-2008 Precast concrete products - Wood-chip concrete shuttering blocks - Product properties and performance German version EN 15498 2008《预制混凝土制品 木屑混凝土模块 产品性能和特性》.pdf DIN EN 15498-2008 Precast concrete products - Wood-chip concrete shuttering blocks - Product properties and performance German version EN 15498 2008《预制混凝土制品 木屑混凝土模块 产品性能和特性》.pdf
  • DIN EN 1550-2008 Machine-tools safety - Safety requirements for the design and construction of work holding chucks German version EN 1550 1997+A1 2008《机械工具的安全性 工件夹具卡盘设计和结构安全性要求》.pdf DIN EN 1550-2008 Machine-tools safety - Safety requirements for the design and construction of work holding chucks German version EN 1550 1997+A1 2008《机械工具的安全性 工件夹具卡盘设计和结构安全性要求》.pdf
  • DIN EN 15500-1-2017 Energy Performance of Buildings - Control for heating ventilating and air conditioning applications - Part 1 Electronic individual zone control equipment - Modu.pdf DIN EN 15500-1-2017 Energy Performance of Buildings - Control for heating ventilating and air conditioning applications - Part 1 Electronic individual zone control equipment - Modu.pdf
  • DIN EN 15501-2016 Thermal insulation products for building equipment and industrial installations - Factory made expanded perlite (EP) and exfoliated vermiculite (EV) products - Sp.pdf DIN EN 15501-2016 Thermal insulation products for building equipment and industrial installations - Factory made expanded perlite (EP) and exfoliated vermiculite (EV) products - Sp.pdf
  • DIN EN 15502-1-2015 Gas-fired heating boilers - Part 1 General requirements and tests German version EN 15502-1 2012+A1 2015《燃气加热锅炉 第1部分 试验和通用要求 德文版本EN 15502-1-2012+A1-2015》.pdf DIN EN 15502-1-2015 Gas-fired heating boilers - Part 1 General requirements and tests German version EN 15502-1 2012+A1 2015《燃气加热锅炉 第1部分 试验和通用要求 德文版本EN 15502-1-2012+A1-2015》.pdf
  • DIN EN 15502-2-1-2017 de 6328 Gas-fired central heating boilers - Part 2-1 Specific standard for type C appliances and type B2 B3 and B5 appliances of a nominal heat input not exce.pdf DIN EN 15502-2-1-2017 de 6328 Gas-fired central heating boilers - Part 2-1 Specific standard for type C appliances and type B2 B3 and B5 appliances of a nominal heat input not exce.pdf
  • 相关搜索

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

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