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

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

1、计算机三级数据库技术-122 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.请编写函数 countValue(),它的功能是:求出 11000 之间能被 7或 11整除但不能同时被 7和 11整除的所有整数,将结果按从小到大的顺序存放在数组 a中,并通过 n计算出这些数的个数。 注意:请勿改动主函数 main()和写函数 writeDAT()的内容。 【试题程序】 #include stdlib.h #include stdio.h void writeDAT () ; void countValue (int * a,int * n)

2、void main () int aa1000,n, k; system (“CLS“) ; countValue (aa, for (k=0;k n;k + ) if ( (k+1) %10=0) printf (“%5d“,aak) ; printf (“n“) ; else printf (“%5d“, aak ); writeDAT (); void writeDAT () int aa1000,n, k; FILE * fp; fp = fopen (“OUT. DAT“, “w“); countValue (aa, for (k=0;kn;k-) if ( (k+1) %10=0)

3、 fprintf (fp, “%5d“, aak ); fprintf (fp, “n“); else fprint f (fp, “%d“, aak ); fclose (fp); (分数:100.00)_计算机三级数据库技术-122 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.请编写函数 countValue(),它的功能是:求出 11000 之间能被 7或 11整除但不能同时被 7和 11整除的所有整数,将结果按从小到大的顺序存放在数组 a中,并通过 n计算出这些数的个数。 注意:请勿改动主函数 main()和写函数 writeDA

4、T()的内容。 【试题程序】 #include stdlib.h #include stdio.h void writeDAT () ; void countValue (int * a,int * n) void main () int aa1000,n, k; system (“CLS“) ; countValue (aa, for (k=0;k n;k + ) if ( (k+1) %10=0) printf (“%5d“,aak) ; printf (“n“) ; else printf (“%5d“, aak ); writeDAT (); void writeDAT () int

5、aa1000,n, k; FILE * fp; fp = fopen (“OUT. DAT“, “w“); countValue (aa, for (k=0;kn;k-) if ( (k+1) %10=0) fprintf (fp, “%5d“, aak ); fprintf (fp, “n“); else fprint f (fp, “%d“, aak ); fclose (fp); (分数:100.00)_正确答案:()解析:void countValue(int *a,int *n) int i; /*定义循环控制变量*/ *n=0 ; /*初始化计数器变量*/ for(i=1;i=10

6、00;i+) /*在这个范围内寻找符合条件的数*/ if(i%7=0 /*保存符合条件的数*/ *n=*n+1; /*统计个数*/ a+; 考点 本题考查对一定范围内整数的筛选。考查的知识点主要包括:if 判断语句和逻辑表达式,指针对存储单元的访问。 解析 此题属于数学类问题。分析题干,本题存在 2个关键点:关键点 1判断条件“能被 7或 11整除但不能同时被 7和 11整除“;关键点 2统计满足条件的数的数量。 本题的解题思路为:通过循环控制,依次判断 1至 1000内的数是否满足关键点 1中的条件。如果满足,则将数据保存到数组中,并统计其数量。 if判断语句中表达式; 指针对存储单元的访问。

展开阅读全文
相关资源
猜你喜欢
  • EN ISO 16000-10-2006 en Indoor air - Part 10 Determination of the emission of volatile organic compounds from building products and furnishing - Emission test cell method《室内空气 第10部.pdf EN ISO 16000-10-2006 en Indoor air - Part 10 Determination of the emission of volatile organic compounds from building products and furnishing - Emission test cell method《室内空气 第10部.pdf
  • EN ISO 16000-11-2006 en Indoor air - Part 11 Determination of the emission of volatile organic compounds from building products and furnishing - Sampling storage of samples and pre.pdf EN ISO 16000-11-2006 en Indoor air - Part 11 Determination of the emission of volatile organic compounds from building products and furnishing - Sampling storage of samples and pre.pdf
  • EN ISO 16000-12-2008 en Indoor air - Part 12 Sampling strategy for polychlorinated biphenyls (PCBs) polychlorinated dibenzo-p-dioxins (PCDDs) polychlorinated dibenzofurans (PCDFs) .pdf EN ISO 16000-12-2008 en Indoor air - Part 12 Sampling strategy for polychlorinated biphenyls (PCBs) polychlorinated dibenzo-p-dioxins (PCDDs) polychlorinated dibenzofurans (PCDFs) .pdf
  • EN ISO 16000-15-2008 en Indoor air - Part 15 Sampling strategy for nitrogen dioxide (NO2)《室内空气 第15部分 二氧化氮(NO2)用取样策略》.pdf EN ISO 16000-15-2008 en Indoor air - Part 15 Sampling strategy for nitrogen dioxide (NO2)《室内空气 第15部分 二氧化氮(NO2)用取样策略》.pdf
  • EN ISO 16000-19-2014 en Indoor air - Part 19 Sampling strategy for moulds《室内空气 第19个部分 霉菌取样策略(ISO 16000-19 2012)》.pdf EN ISO 16000-19-2014 en Indoor air - Part 19 Sampling strategy for moulds《室内空气 第19个部分 霉菌取样策略(ISO 16000-19 2012)》.pdf
  • EN ISO 16000-2-2006 en Indoor air - Part 2 Sampling strategy for formaldehyde《室内空气 第2部分 甲醛的抽样方法》.pdf EN ISO 16000-2-2006 en Indoor air - Part 2 Sampling strategy for formaldehyde《室内空气 第2部分 甲醛的抽样方法》.pdf
  • EN ISO 16000-26-2012 en Indoor air - Part 26 Sampling strategy for carbon dioxide (CO2)《室内空气 第26部分 二氧化碳取样策略》.pdf EN ISO 16000-26-2012 en Indoor air - Part 26 Sampling strategy for carbon dioxide (CO2)《室内空气 第26部分 二氧化碳取样策略》.pdf
  • EN ISO 16000-32-2014 en Indoor air - Part 32 Investigation of buildings for the occurrence of pollutants《室内空气 第32部分 发生建筑污染的调查(ISO 16000-32 2014)》.pdf EN ISO 16000-32-2014 en Indoor air - Part 32 Investigation of buildings for the occurrence of pollutants《室内空气 第32部分 发生建筑污染的调查(ISO 16000-32 2014)》.pdf
  • EN ISO 16000-5-2007 en Indoor air - Part 5 Sampling strategy for volatile organic compounds (VOCs)《室内空气 第5部分 挥发性有机化合物(VOCs)取样法》.pdf EN ISO 16000-5-2007 en Indoor air - Part 5 Sampling strategy for volatile organic compounds (VOCs)《室内空气 第5部分 挥发性有机化合物(VOCs)取样法》.pdf
  • 相关搜索

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

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