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

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

1、计算机三级数据库技术(上机操作)机试模拟试卷 75及答案与解析 一、程序设计题 1 已知数据文件 in dat中存有 300个四位数,并已调用读函数 readDat()把这些数存人数组 a中,请编写函数 jsValue()。其功能是;求出千位数上的数加百位数上的数等于十位数上的数加个位数上的数的个数 cnt,再求出所有满足此条件的四位数的平均值 pjz1,以及所有不满足此条件的四位数的平均值 pjz2。最后通过 main()函数调用写函数 writeDat(),把结果 cnt、 pjzl、 pjz2输出到 out dat文件。 例如: 7153.7+1=5+3,则该数满足条件。参 加计算平均值

2、 pjzl,且个数 cnt=cnt+1。 8129, 8+1 1=2+9,则该数不满足条 件,参加计算平均值 pjz2。 【试题程序】 #include int a300, cnt=O; double pjzl=0 0, pjz2=0 0; void readDat(); void writeDat(); void jsValue() void main() readDat(); jsValue(); writeDat(); printf(“cnt= d n满足条件的平均值 pjzl= 7 21f n不满足条件的平均值 pjz2= 7 2; n”, cnt, pjzl, pjz2); void

3、 readDat() FILE*fp; int i; fp=fopen(“in dat”。 “r”); for(i=0; i300; i+) fscanf(fp, “ d, ”。 fclose(fp), void writeDat() FILE*fp; fp=fopen(“out dat”, “W”); fprintf(fp “ d n 7 21f n 7 21f n” cnt, pjz1, pjz2); fclose(fp); 计算机三级数据库技术(上机操作)机试模拟试卷 75答案与解析 一、程序设计题 1 【正确答案】 void jsValue() int i; *定义变量 * int a1, a2, a3,a4; for(i=0; i300;i+) alai 10; *数位分解 * a2一 ai 100 10; a3一 ai9, 61000 100; a4一 ai 1000; if(a4+a3=a2+a1) *判断条件 * pjzl+=ai cnt+; else pjz2+=ai; pjz1 =cnt; *求平均值 * pjz2 =(300一 cnt);

展开阅读全文
相关资源
猜你喜欢
  • STAS SR ISO 7851-1993 Fertilizsrs and soil conditioners Classification《肥料和土壤调理物质 分类》.pdf STAS SR ISO 7851-1993 Fertilizsrs and soil conditioners Classification《肥料和土壤调理物质 分类》.pdf
  • STAS SR ISO 7857-1-1996 Intra-uterine devices Part 1 Determination of breaking force《宫内器具 第1部分:断裂强力的测定 》.pdf STAS SR ISO 7857-1-1996 Intra-uterine devices Part 1 Determination of breaking force《宫内器具 第1部分:断裂强力的测定 》.pdf
  • STAS SR ISO 7857-3-1996 Intra-uterine devices Part 3 Packaging and labelling《宫内器具 第3部分:包装和标签 》.pdf STAS SR ISO 7857-3-1996 Intra-uterine devices Part 3 Packaging and labelling《宫内器具 第3部分:包装和标签 》.pdf
  • STAS SR ISO 7858-1-1996 Measurement of water flow in closed conduite Meters for cold potable water - Combination meters Part 1 Specifications《密闭管道中水流量的测量 冷饮用水的测量仪表 复合式测量仪 第1部分:规格 》.pdf STAS SR ISO 7858-1-1996 Measurement of water flow in closed conduite Meters for cold potable water - Combination meters Part 1 Specifications《密闭管道中水流量的测量 冷饮用水的测量仪表 复合式测量仪 第1部分:规格 》.pdf
  • STAS SR ISO 7858-2-1996 Measurement of water flow in closed conduits-Meters for cold potable water - Combination meters Part 2 Installation requirements《密闭管道水流量的测定 冷饮用水的仪表 复合仪表 第2部.pdf STAS SR ISO 7858-2-1996 Measurement of water flow in closed conduits-Meters for cold potable water - Combination meters Part 2 Installation requirements《密闭管道水流量的测定 冷饮用水的仪表 复合仪表 第2部.pdf
  • STAS SR ISO 7858-3-1996 Measurement of water flow in closed conduits Meters for cold potable water - Combination meters Part 3 Test methods《封闭管道中水流量的测量 冷饮用水表 组合水表 第3部分:试验方法 》.pdf STAS SR ISO 7858-3-1996 Measurement of water flow in closed conduits Meters for cold potable water - Combination meters Part 3 Test methods《封闭管道中水流量的测量 冷饮用水表 组合水表 第3部分:试验方法 》.pdf
  • STAS SR ISO 7863-1994 Height setting micrometers and riser blocks《高度调节测微计和调整垫块 》.pdf STAS SR ISO 7863-1994 Height setting micrometers and riser blocks《高度调节测微计和调整垫块 》.pdf
  • STAS SR ISO 7875-1-1996 Water quality - Determination of surfactants - Part 1 Determination of anionic surfactants by the methylene blue spectrometric method《水质 表面活性剂的测定 第1部分:亚甲蓝光谱.pdf STAS SR ISO 7875-1-1996 Water quality - Determination of surfactants - Part 1 Determination of anionic surfactants by the methylene blue spectrometric method《水质 表面活性剂的测定 第1部分:亚甲蓝光谱.pdf
  • STAS SR ISO 7875-2-1996 Water quality - Determination of surfactants Part 2  Determination of non-ionic surfactants using Dragendorff reagent《水质 表面活性剂的测定 第2部分:用德雷根道尔夫试剂测定非离子表面活化剂 》.pdf STAS SR ISO 7875-2-1996 Water quality - Determination of surfactants Part 2 Determination of non-ionic surfactants using Dragendorff reagent《水质 表面活性剂的测定 第2部分:用德雷根道尔夫试剂测定非离子表面活化剂 》.pdf
  • 相关搜索

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

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