【计算机类职业资格】计算机三级数据库技术-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位数添加到和值中。

展开阅读全文
相关资源
猜你喜欢
  • DIN EN ISO 10714-2002 Steel and iron - Determination of phosphorus content - Phosphovanadomolybdate spectrophotometric method (ISO 10714 1992) German version EN ISO 10714 2002《钢和铁 .pdf DIN EN ISO 10714-2002 Steel and iron - Determination of phosphorus content - Phosphovanadomolybdate spectrophotometric method (ISO 10714 1992) German version EN ISO 10714 2002《钢和铁 .pdf
  • DIN EN ISO 10715-2000 Natural gas - Sampling guidelines (ISO 10715 1997) German version EN ISO 10715 2000《天然气 取样导则》.pdf DIN EN ISO 10715-2000 Natural gas - Sampling guidelines (ISO 10715 1997) German version EN ISO 10715 2000《天然气 取样导则》.pdf
  • DIN EN ISO 10717-2011 Footwear - Test methods for slide fasteners - Burst strength (ISO 10717 2010) German version EN ISO 10717 2010《鞋类 拉链测试方法 胀破强度(ISO 10717-2010) 德文版本EN ISO 10717.pdf DIN EN ISO 10717-2011 Footwear - Test methods for slide fasteners - Burst strength (ISO 10717 2010) German version EN ISO 10717 2010《鞋类 拉链测试方法 胀破强度(ISO 10717-2010) 德文版本EN ISO 10717.pdf
  • DIN EN ISO 10720-2007 Steel and iron - Determination of nitrogen content - Thermal conductimetric method after fusion in a current of inert gas (ISO 10720 1997) English version of .pdf DIN EN ISO 10720-2007 Steel and iron - Determination of nitrogen content - Thermal conductimetric method after fusion in a current of inert gas (ISO 10720 1997) English version of .pdf
  • DIN EN ISO 10722-2007 Geosynthetics - Index test procedure for the evaluation of mechanical damage under repeated loading - Damage caused by granular material (ISO 10722 2007) Engl.pdf DIN EN ISO 10722-2007 Geosynthetics - Index test procedure for the evaluation of mechanical damage under repeated loading - Damage caused by granular material (ISO 10722 2007) Engl.pdf
  • DIN EN ISO 10723-2013 Natural gas - Performance evaluation for analytical systems (ISO 10723 2012) German version EN ISO 10723 2012《天然气 分析系统的性能评估(ISO 10723-2012) 德文版本EN ISO 10723-2.pdf DIN EN ISO 10723-2013 Natural gas - Performance evaluation for analytical systems (ISO 10723 2012) German version EN ISO 10723 2012《天然气 分析系统的性能评估(ISO 10723-2012) 德文版本EN ISO 10723-2.pdf
  • DIN EN ISO 10724-1-2002 Plastics - Injection moulding of test specimens of thermosetting powder moulding compounds (PMCs) - Part 1 General principles and moulding of multipurpose t.pdf DIN EN ISO 10724-1-2002 Plastics - Injection moulding of test specimens of thermosetting powder moulding compounds (PMCs) - Part 1 General principles and moulding of multipurpose t.pdf
  • DIN EN ISO 10724-2-2000 Plastics - Injection moulding of test specimens of thermosetting powder moulding compounds (PMCs) - Part 2 Small plates (ISO 10724-2 1998) German version EN.pdf DIN EN ISO 10724-2-2000 Plastics - Injection moulding of test specimens of thermosetting powder moulding compounds (PMCs) - Part 2 Small plates (ISO 10724-2 1998) German version EN.pdf
  • DIN EN ISO 10734-2016 Footwear - Test method for slide fasteners - Strength of slide fastener pullers (ISO 10734 2016) German version EN ISO 10734 2016《鞋类 拉链的试验方法 拉链拉具的强度(ISO 10734.pdf DIN EN ISO 10734-2016 Footwear - Test method for slide fasteners - Strength of slide fastener pullers (ISO 10734 2016) German version EN ISO 10734 2016《鞋类 拉链的试验方法 拉链拉具的强度(ISO 10734.pdf
  • 相关搜索

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

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