【计算机类职业资格】计算机三级数据库技术-77及答案解析.doc

上传人:proposalcash356 文档编号:1337526 上传时间:2019-10-17 格式:DOC 页数:3 大小:26KB
下载 相关 举报
【计算机类职业资格】计算机三级数据库技术-77及答案解析.doc_第1页
第1页 / 共3页
【计算机类职业资格】计算机三级数据库技术-77及答案解析.doc_第2页
第2页 / 共3页
【计算机类职业资格】计算机三级数据库技术-77及答案解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机三级数据库技术-77 及答案解析(总分:100.00,做题时间:90 分钟)1.下列程序的功能是:计算出自然数 SIX和 NINE,它们满足的条件是 SIX+SIX+SIX=NINE+NINE的个数cnt,以及满足此条件的所有 SIX与 NINE的和 sum。请编写函数 countValue()实现程序功能,最后调用函数 writetDAT(),把结果 cnt和 sum输出到文件 OUT.DAT中。其中的 S,I,X,N,E 各代表一个十进制数。请勿改动主函数 main()和写函数 writeDAT()的内容。 试题程序 #includestdio.h int cnt, sum; voi

2、d writeDAT(); void countValue() void main() cnt=sum=0; countValue(); printf(“满足条件的数的个数=%dn“, cnt); printf(“满足条件的所有 SIX与 NINE的和=%dn“, sum); writeDAT(); void writeDAT() FILE*fp; fp=fopen(“OUT.DAT“, “w“); fprintf(fp, “%dn%dn“, cnt, sum); fclose(fp); (分数:100.00)_计算机三级数据库技术-77 答案解析(总分:100.00,做题时间:90 分钟)1

3、下列程序的功能是:计算出自然数 SIX和 NINE,它们满足的条件是 SIX+SIX+SIX=NINE+NINE的个数cnt,以及满足此条件的所有 SIX与 NINE的和 sum。请编写函数 countValue()实现程序功能,最后调用函数 writetDAT(),把结果 cnt和 sum输出到文件 OUT.DAT中。其中的 S,I,X,N,E 各代表一个十进制数。请勿改动主函数 main()和写函数 writeDAT()的内容。 试题程序 #includestdio.h int cnt, sum; void writeDAT(); void countValue() void main(

4、) cnt=sum=0; countValue(); printf(“满足条件的数的个数=%dn“, cnt); printf(“满足条件的所有 SIX与 NINE的和=%dn“, sum); writeDAT(); void writeDAT() FILE*fp; fp=fopen(“OUT.DAT“, “w“); fprintf(fp, “%dn%dn“, cnt, sum); fclose(fp); (分数:100.00)_正确答案:()解析:void countValue() int i, j; int s2; int n2, n3, n4; for(i=100; i1000; i+)

5、 for(j=1000; j10000; j+) if(i*3=j*2) s2=i%100/10; n4=j/1000; n3=j%1000/100; n2=j%100/10; if(s2=n3 sum+=i+j; 考点 本题主要考查的知识点包括:C 语言循环结构,if 判断语句和逻辑表达式,以及分解多位整数的算术运算。 分析题干,本题除给出条件“SIX+SIX+SIX=NINE+NINE“之外,还可得出 2个隐含的条件:条件 1:SIX 和NINE分别是 3位和 4位的正整数;条件 2:SIX 的十位数字等于 NINE的百位数字,NINE 的千位数字和十位数字相等。 本题解题思路:通过嵌套的循环结构可以遍历到所有的 3位和 4位数,对于每一个 3位数及 4位数的组合进行题设条件(SIX+SIX+SIX=NINE+NINE)的判断,满足条件的对其分解得到各数位的数字,再进一步判断各位数字是否满足本题隐含的条件(条件 1及条件 2),如果满足则个数加 1,并将该 3位数及 4位数添加到和值中。

展开阅读全文
相关资源
猜你喜欢
  • BS PD CEN TR 16998-2016 Ambient air Report on nitro- and oxy-PAHs Origin toxicity concentrations and measurement methods《环境空气 硝基多环芳烃和氧化多环芳烃报告 来源 毒性 浓度和测量方法》.pdf BS PD CEN TR 16998-2016 Ambient air Report on nitro- and oxy-PAHs Origin toxicity concentrations and measurement methods《环境空气 硝基多环芳烃和氧化多环芳烃报告 来源 毒性 浓度和测量方法》.pdf
  • BS PD CEN TR 17004-2016 Mechanical products Conditions to set up environmental communication models by recognizing sectorial particularities《机械产品 通过识别分类特征设置环境通信模型的条件》.pdf BS PD CEN TR 17004-2016 Mechanical products Conditions to set up environmental communication models by recognizing sectorial particularities《机械产品 通过识别分类特征设置环境通信模型的条件》.pdf
  • BS PD CEN TR 17005-2016 Sustainability of construction works Additional environmental impact categories and indicators Background information and possibilities Evaluation .pdf BS PD CEN TR 17005-2016 Sustainability of construction works Additional environmental impact categories and indicators Background information and possibilities Evaluation .pdf
  • BS PD CEN TR 17024-2017 Natural stones Guidance for use of natural stones《天然石料 天然石料使用指南》.pdf BS PD CEN TR 17024-2017 Natural stones Guidance for use of natural stones《天然石料 天然石料使用指南》.pdf
  • BS PD CEN TR 17039-2017 Railway applications Technical Report about the revision of EN 14363《轨道交通 EN 14363修改技术报告》.pdf BS PD CEN TR 17039-2017 Railway applications Technical Report about the revision of EN 14363《轨道交通 EN 14363修改技术报告》.pdf
  • BS PD CEN TR 17040-2017 Fertilizers and liming materials Sampling of static heaps Technical report on experimental sampling trials performed under mandate M 454《肥料和石灰质材料 静.pdf BS PD CEN TR 17040-2017 Fertilizers and liming materials Sampling of static heaps Technical report on experimental sampling trials performed under mandate M 454《肥料和石灰质材料 静.pdf
  • BS PD CEN TR 17055-2017 Workplace exposure Measurement of chemical agents complying with the requirements given in EN 482 and either one of EN 838 EN 1076 EN 13205 EN 1389.pdf BS PD CEN TR 17055-2017 Workplace exposure Measurement of chemical agents complying with the requirements given in EN 482 and either one of EN 838 EN 1076 EN 13205 EN 1389.pdf
  • BS PD CEN TR 17063-2017 Foods of plant origin Multimethod for the determination of pesticide residues using GC- or LC-based analysis following acetonitrile extraction part.pdf BS PD CEN TR 17063-2017 Foods of plant origin Multimethod for the determination of pesticide residues using GC- or LC-based analysis following acetonitrile extraction part.pdf
  • BS PD CEN TR 17068-2017 Sealants for non-structural use in joints in buildings and pedestrian walkways Guidance for CE marking and Declaration of Performance (DoP)《建筑物和人行道.pdf BS PD CEN TR 17068-2017 Sealants for non-structural use in joints in buildings and pedestrian walkways Guidance for CE marking and Declaration of Performance (DoP)《建筑物和人行道.pdf
  • 相关搜索

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

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