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

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

1、计算机三级数据库技术(上机操作)机试模拟试卷 33及答案与解析 一、程序设计题 1 函数 ReadDat()实现从数据文件 in dat中读取 1000个十进制整数到数组 xx中,请编写函数 Compute()分别计算出数组 XX中数值为奇数的个数 odd,数组 xx中所有奇数的平均值 ave1,并求出数组 xx中数值为偶数的平均值 ave2以及所有奇数的方差 totfe的值,最后调用函数 WriteDat()把结果输出到 out dat文件中。计算方差的公式如下: 设 N为奇数的个数, xxi为奇数, avel为奇数的平均值。 原 始数据文件存放的格式是:每行存放 10个数,并用逗号隔开 (

2、每个数 均大于 0且小于等于 2000)。【试题程序】 #include #include #include 世 define MAX 1000 int xxEMAX, odd=0, even=O; double avel=0 0, ave2=0 0,totfc=0 0; void WriteDat(void)l int ReadDat(void) FILE*fp; int i; if(fp=fopen(“in dat”, “r”)=NULL: return 1; for(i=0;i 计算机三级数据库技术(上机操 作)机试模拟试卷 33答案与解析 一、程序设计题 1 【正确答案】 void Compute(void) int if *定义变量 * for(i=0; iMAX;i+) *统计求和 * if(xxi 2=1) odd+; avel+=xxi; else ave2+=xxi: ave1 =odd; *求平均值 * ave2 =(MAXodd); for(i=0;iMAX;i+) *求方差值 * if(xxi 2=1) totfc+=(xxEi-1一 ave1)*(xxi一 avel) odd;

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 4557-2000 Aerospace Series Pipe Coupling 37 Degree Spherical in Heat Resisting Steel Tees Nipples Welded Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 焊接式带喷嘴T形接头 英制系列.pdf ASD-STAN PREN 4557-2000 Aerospace Series Pipe Coupling 37 Degree Spherical in Heat Resisting Steel Tees Nipples Welded Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 焊接式带喷嘴T形接头 英制系列.pdf
  • ASD-STAN PREN 4560-2013 Aerospace Series Pipe Coupling 37 Degrees Spherical Up to 21 000 kPa Inch Series Technical Specification (Edition P 2).pdf ASD-STAN PREN 4560-2013 Aerospace Series Pipe Coupling 37 Degrees Spherical Up to 21 000 kPa Inch Series Technical Specification (Edition P 2).pdf
  • ASD-STAN PREN 4561-2000 Aerospace Series Pipe Coupling Welded in Heat Resisting Steel Elbow 90 Degree Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 90°弯头 英制系列 第P1版》.pdf ASD-STAN PREN 4561-2000 Aerospace Series Pipe Coupling Welded in Heat Resisting Steel Elbow 90 Degree Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 90°弯头 英制系列 第P1版》.pdf
  • ASD-STAN PREN 4562-2000 Aerospace Series Pipe Coupling Welded in Heat Resisting Steel Reductors Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 缩径接头 英制系列 第P1版》.pdf ASD-STAN PREN 4562-2000 Aerospace Series Pipe Coupling Welded in Heat Resisting Steel Reductors Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 缩径接头 英制系列 第P1版》.pdf
  • ASD-STAN PREN 4563-2000 Aerospace Series Pipe Coupling Welded in Heat Resisting Steel Tees Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 T形接头 英制系列 第P1版》.pdf ASD-STAN PREN 4563-2000 Aerospace Series Pipe Coupling Welded in Heat Resisting Steel Tees Inch Series (Edition P 1)《航空航天系列 耐热钢制球形37°管接头 T形接头 英制系列 第P1版》.pdf
  • ASD-STAN PREN 4566-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted Solution Treated Forgings De Less Than or Equal to 100 mm (Edition P1)《航空航天系列 De.pdf ASD-STAN PREN 4566-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted Solution Treated Forgings De Less Than or Equal to 100 mm (Edition P1)《航空航天系列 De.pdf
  • ASD-STAN PREN 4567-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted solution Treated Bar and Section a or D Less Than or Equal to 100 mm (Edition P1.pdf ASD-STAN PREN 4567-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted solution Treated Bar and Section a or D Less Than or Equal to 100 mm (Edition P1.pdf
  • ASD-STAN PREN 4568-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted Solution Treated Sheet and Strip a Less Than or Equal to 6 mm (Edition P1)《航空航天系.pdf ASD-STAN PREN 4568-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted Solution Treated Sheet and Strip a Less Than or Equal to 6 mm (Edition P1)《航空航天系.pdf
  • ASD-STAN PREN 4569-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted Solution Treated Wire D Less Than or Equal to 4 mm (Edition P1)《航空航天系列 耐热合金CO-PH.pdf ASD-STAN PREN 4569-1999 Aerospace Series Heat Resisting Alloy CO-PH4101 (CoCr20W15Ni) Vacuum Melted Solution Treated Wire D Less Than or Equal to 4 mm (Edition P1)《航空航天系列 耐热合金CO-PH.pdf
  • 相关搜索

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

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