[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷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。可据此来对数据进行判断看是否符合条件。

展开阅读全文
相关资源
猜你喜欢
  • ASTM A690 A690M-2007 Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use in Mar.pdf ASTM A690 A690M-2007 Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use in Mar.pdf
  • ASTM A690 A690M-2007(2012) Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use .pdf ASTM A690 A690M-2007(2012) Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use .pdf
  • ASTM A690 A690M-2013 Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use in Mar.pdf ASTM A690 A690M-2013 Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use in Mar.pdf
  • ASTM A690 A690M-2013a Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use in Ma.pdf ASTM A690 A690M-2013a Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use in Ma.pdf
  • ASTM A690 A690M-2013a(2018) Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use.pdf ASTM A690 A690M-2013a(2018) Standard Specification for High-Strength Low-Alloy Nickel Copper Phosphorus Steel H-Piles and Sheet Piling with Atmospheric Corrosion Resistance for Use.pdf
  • ASTM A691 A691M-2009 Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压条件下电融焊碳钢管和合金钢管用标准规范》.pdf ASTM A691 A691M-2009 Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压条件下电融焊碳钢管和合金钢管用标准规范》.pdf
  • ASTM A691 A691M-2009(2014) Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压条件下电融焊碳钢管和合金钢管用标准规格》.pdf ASTM A691 A691M-2009(2014) Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压条件下电融焊碳钢管和合金钢管用标准规格》.pdf
  • ASTM A691 A691M-2009e1 Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压条件下电融焊碳钢管和合金钢管用标准规格》.pdf ASTM A691 A691M-2009e1 Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压条件下电融焊碳钢管和合金钢管用标准规格》.pdf
  • ASTM A691 A691M-2018 Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压用电熔焊碳和合金钢管标准规范》.pdf ASTM A691 A691M-2018 Standard Specification for Carbon and Alloy Steel Pipe Electric-Fusion-Welded for High-Pressure Service at High Temperatures《高温高压用电熔焊碳和合金钢管标准规范》.pdf
  • 相关搜索

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

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