[计算机类试卷]计算机三级数据库技术(上机操作)机试模拟试卷28及答案与解析.doc

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

1、计算机三级数据库技术(上机操作)机试模拟试卷 28及答案与解析 一、程序设计题 1 请编写函数 countValue(int n),它的功能是:求 n以内 (不包括 n)同时能被 3与 7整除的所有自然数和的平均值的平方根 s, S作为函数返回值,最后结果 S输出到文件 out dat中。例如若 n为 1000时,函数值应为: s=22 449944。 【试题程序】 #include #include void progReadWrite(); double countValue(int n) main() printf(”自然数和的平均值的平方根 = f n”。 countValue(100

2、0); progReadWrite(); void progReadWrite() FILE*fp, *wf, int i, n; double s; fp=fopen(“in dat”, “r”); if(fp=NULL) printf(”数据文件 in dat不存在 !”); return; wf=fopen(“out dat”, ”w”); for(i: 0; i10; i+) fscanf(fp “ d”, fclose(fp); fclose(wf); 计算机三级数据库技术(上机操作)机试模拟试卷 28答案与解析 一、程序设计题 1 【正确答案】 double countValue(int n) int i, cnt=0; *定义变量并初始化 *; double sum=0 0; for(i=1; in; i+) *统计求和 * if(i 3=0 i 7=0) sum+=i; cnt+; sum =cnt; *求平均值 * sum: sqrt(sum); *求平方根 * return sum; *返回结果 *

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 2349-304-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 304 Operate and Release Time (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第304部分.pdf ASD-STAN PREN 2349-304-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 304 Operate and Release Time (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第304部分.pdf
  • ASD-STAN PREN 2349-305-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 305 Bounce Time (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第305部分 弹跳时间 第P1版》.pdf ASD-STAN PREN 2349-305-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 305 Bounce Time (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第305部分 弹跳时间 第P1版》.pdf
  • ASD-STAN PREN 2349-306-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 306 Overload D C and A C (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第306部分 过载D.pdf ASD-STAN PREN 2349-306-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 306 Overload D C and A C (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第306部分 过载D.pdf
  • ASD-STAN PREN 2349-307-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 307 Contact Voltage Drop (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第307部分 触点电.pdf ASD-STAN PREN 2349-307-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 307 Contact Voltage Drop (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第307部分 触点电.pdf
  • ASD-STAN PREN 2349-308-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 308 Coil Current (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第308部分 线圈电流 第P1版》.pdf ASD-STAN PREN 2349-308-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 308 Coil Current (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第308部分 线圈电流 第P1版》.pdf
  • ASD-STAN PREN 2349-309-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 309 Exported Spikes (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第309部分 输出尖峰信号 第.pdf ASD-STAN PREN 2349-309-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 309 Exported Spikes (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第309部分 输出尖峰信号 第.pdf
  • ASD-STAN PREN 2349-310-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 310 Rupture (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第310部分 爆裂 第P1版》.pdf ASD-STAN PREN 2349-310-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 310 Rupture (Edition P 1)《航空航天系列 继电器和触点的要求和试验方法 第310部分 爆裂 第P1版》.pdf
  • ASD-STAN PREN 2349-312-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 312 Electrical Service Life - Mixed Load (Edition P 1)《航空航天系列 继电器和触点的要求.pdf ASD-STAN PREN 2349-312-2000 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 312 Electrical Service Life - Mixed Load (Edition P 1)《航空航天系列 继电器和触点的要求.pdf
  • ASD-STAN PREN 2349-313-1999 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 313 Electrical Service Life - Resistive Load (Edition 3E)《航空航天系列 继电器和触点.pdf ASD-STAN PREN 2349-313-1999 Aerospace Series Requirements and Test Procedures for Relays and Contactors Part 313 Electrical Service Life - Resistive Load (Edition 3E)《航空航天系列 继电器和触点.pdf
  • 相关搜索

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

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