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

展开阅读全文
相关资源
猜你喜欢
  • EN 13763-25-2004 en Explosives for civil uses - Detonators and relays - Part 25 Determination of transfer capability of surface connectors relays and coupling accessories《民用爆炸物 雷管和.pdf EN 13763-25-2004 en Explosives for civil uses - Detonators and relays - Part 25 Determination of transfer capability of surface connectors relays and coupling accessories《民用爆炸物 雷管和.pdf
  • EN 13763-26-2004 en Explosives for civil uses - Detonators and relays - Part 26 Definitions methods and requirements for devices and accessories for reliable and safe function of d.pdf EN 13763-26-2004 en Explosives for civil uses - Detonators and relays - Part 26 Definitions methods and requirements for devices and accessories for reliable and safe function of d.pdf
  • EN 13763-3-2002 en Explosives for civil uses Detonators and relays Part 3 Determination of sensitiveness to impact《民用爆炸物 雷管和继电器 第3部分 冲击灵敏度的测定》.pdf EN 13763-3-2002 en Explosives for civil uses Detonators and relays Part 3 Determination of sensitiveness to impact《民用爆炸物 雷管和继电器 第3部分 冲击灵敏度的测定》.pdf
  • EN 13763-4-2003 en Explosives for civil uses Detonators and relays Part 4 Determination of resistance to abrasion of leading wires and shock tubes《民用爆炸物 雷管和继电器 第4部分 引线和冲击管耐磨性的测定》.pdf EN 13763-4-2003 en Explosives for civil uses Detonators and relays Part 4 Determination of resistance to abrasion of leading wires and shock tubes《民用爆炸物 雷管和继电器 第4部分 引线和冲击管耐磨性的测定》.pdf
  • EN 13763-5-2003 en Explosives for civil uses Detonators and relays Part 5 Determination of resistance to cutting damage of leading wires and shock tubes《民用爆炸物 雷管和传爆管 第5部分 引线和激波管耐切割.pdf EN 13763-5-2003 en Explosives for civil uses Detonators and relays Part 5 Determination of resistance to cutting damage of leading wires and shock tubes《民用爆炸物 雷管和传爆管 第5部分 引线和激波管耐切割.pdf
  • EN 13763-6-2003 en Explosives for civil uses Detonators and relays Part 6 Determination of resistance to cracking in low temperatures of leading wires《民用爆炸物 雷管和传爆管 第6部分 引线耐低温断裂的测定》.pdf EN 13763-6-2003 en Explosives for civil uses Detonators and relays Part 6 Determination of resistance to cracking in low temperatures of leading wires《民用爆炸物 雷管和传爆管 第6部分 引线耐低温断裂的测定》.pdf
  • EN 13763-7-2003 en Explosives for civil uses Detonators and relays Part 7 Determination of the mechanical strength of leading wires shock tubes connections crimps and closures《民用炸药.pdf EN 13763-7-2003 en Explosives for civil uses Detonators and relays Part 7 Determination of the mechanical strength of leading wires shock tubes connections crimps and closures《民用炸药.pdf
  • EN 13763-8-2003 en Explosives for civil uses Detonators and relays Part 8 Determination of the resistance to vibration of plain detonators《民用爆炸物 雷管和继电器 第8部分 普通炸药抗振性的测定》.pdf EN 13763-8-2003 en Explosives for civil uses Detonators and relays Part 8 Determination of the resistance to vibration of plain detonators《民用爆炸物 雷管和继电器 第8部分 普通炸药抗振性的测定》.pdf
  • EN 13763-9-2003 en Explosives for civil uses - Detonators and relays - Part 9 Determination of resistance to bending of detonators《民用爆炸物 雷管和传爆管 第9部分 雷管抗弯性的测定》.pdf EN 13763-9-2003 en Explosives for civil uses - Detonators and relays - Part 9 Determination of resistance to bending of detonators《民用爆炸物 雷管和传爆管 第9部分 雷管抗弯性的测定》.pdf
  • 相关搜索

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

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