[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷31及答案与解析.doc

上传人:appealoxygen216 文档编号:505691 上传时间:2018-11-29 格式:DOC 页数:2 大小:24.50KB
下载 相关 举报
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷31及答案与解析.doc_第1页
第1页 / 共2页
[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷31及答案与解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机三级网络技术机试(上机操作)模拟试卷 31及答案与解析 一、程序设计题 1 请编写函数 countValue(int n)。其功能是:求 n以内 (不包括 n)同时能被 3与 7整除的所有自然数之和的平方根 s,并作为函数值返回,最后结果 S输出到文件OUT DAT中。 例如,若 n为 1000时,函数值应为 s=153 909064。 注意:部分源程序已给出。 请勿改动主函数 main()和写函数 WriteData()的内容。 试题程序: #include #include #include void progReadWrite(); double countValue(int n)

2、 void main() system(“CLS”); printf(“自然数之和的平方根 = f n”, countValue (1000); Write Data(); void Write Data() FILE*wf; double s; wf=fopen(“OUT DAT”, “W”); a=countValue(1000); fprintf(wf, “aqrt= f n” s); fclose(wf); 计算机三级网络技术机试(上机操作)模拟试卷 31答案与解析 一、程序设计题 1 【正确答案】 double countValue(int n) int i, sum=0; for(i=0; in; i+) if(i 3=0 i 7=0)sum+=i; 如果满足条件,就将该数加入总和 return sqrt(sum); 求出总和的平方根 【试题解析】 若一个数 m能被 n整除则有 m n=0。可据此来对数据进行判断看是否符合条件。

展开阅读全文
相关资源
猜你喜欢
  • STAS SR ISO 1798-1983 Polymeric materials cellular flexible Determination of tensiie strength and elongation at break.《高聚物多孔材料.张力强度和断裂延伸率的测定》.pdf STAS SR ISO 1798-1983 Polymeric materials cellular flexible Determination of tensiie strength and elongation at break.《高聚物多孔材料.张力强度和断裂延伸率的测定》.pdf
  • STAS SR ISO 1807-1995 Continuous mechanica! handling equipment for loose bulk materials - Oscillating conveyors and shaking or reciprocating feeders with rectangular or trapezoidal.pdf STAS SR ISO 1807-1995 Continuous mechanica! handling equipment for loose bulk materials - Oscillating conveyors and shaking or reciprocating feeders with rectangular or trapezoidal.pdf
  • STAS SR ISO 1815-1995 Continuous mechanical handling equipment for Ioose bulk materials -Vibrating feeders and conveyors《大量松散材料的连续机械装卸设备.振动供料机和传送带 》.pdf STAS SR ISO 1815-1995 Continuous mechanical handling equipment for Ioose bulk materials -Vibrating feeders and conveyors《大量松散材料的连续机械装卸设备.振动供料机和传送带 》.pdf
  • STAS SR ISO 1816-1995 Continuous mechanical handling equipment for loose bulk materials and unit loads - Belt conveyors - Basic characteristics of motorized driving pulleys《大型松散材料和.pdf STAS SR ISO 1816-1995 Continuous mechanical handling equipment for loose bulk materials and unit loads - Belt conveyors - Basic characteristics of motorized driving pulleys《大型松散材料和.pdf
  • STAS SR ISO 1819-1994 Continuous mechanical handling equipment - Safety code - General rules《连续机械装卸设备.安全规范.一般规则 》.pdf STAS SR ISO 1819-1994 Continuous mechanical handling equipment - Safety code - General rules《连续机械装卸设备.安全规范.一般规则 》.pdf
  • STAS SR ISO 1826-1981 Vulcanized rubber Time interval between vulcanization and testing - Specifications《硫化橡胶 硫化和测试的时间间隔.规格》.pdf STAS SR ISO 1826-1981 Vulcanized rubber Time interval between vulcanization and testing - Specifications《硫化橡胶 硫化和测试的时间间隔.规格》.pdf
  • STAS SR ISO 1832-1995 Indexable inserts for cutting tools - Designation《切削工具的刀片.指定 》.pdf STAS SR ISO 1832-1995 Indexable inserts for cutting tools - Designation《切削工具的刀片.指定 》.pdf
  • STAS SR ISO 1833+A1-1995 Textiles - Binary fibre mixtures - Quantitative chemical analysis《纺织.二元纤维混合物.定量化学分析 》.pdf STAS SR ISO 1833+A1-1995 Textiles - Binary fibre mixtures - Quantitative chemical analysis《纺织.二元纤维混合物.定量化学分析 》.pdf
  • STAS SR ISO 1872-1-1995 Plastics - Polyethylene (PE) moulding and extrusion materials-Part 1  Designation system and basis for specifications《塑料.聚乙烯PE模塑和喷出材料.第1部分:表示系统和基础规范》.pdf STAS SR ISO 1872-1-1995 Plastics - Polyethylene (PE) moulding and extrusion materials-Part 1 Designation system and basis for specifications《塑料.聚乙烯PE模塑和喷出材料.第1部分:表示系统和基础规范》.pdf
  • 相关搜索

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

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