[计算机类试卷]国家三级(数据库技术)机试模拟试卷79及答案与解析.doc

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

1、国家三级(数据库技术)机试模拟试卷 79及答案与解析 一、程序设计题 1 请编写函数 void countValue(int *a, int *n),它的功能是:求出 1到 1000之内能被 7或 11整除但不能同时被 7和 11整除的所有整数并存放在数组 a中,并通过 n返回这些数的个数。 注意:部分源程序已给出。 请勿改动主函数 main()和写函数 writeDAT()的内容。 试题程序: #include conio.h #include stdio.h void countValue(int *a, int *n) main ( ) int aa1000,n, k; clrscr()

2、 countValue (aa, for(k=0;k n; k+) if(k+1) %10 =0) printf(“%5d“,aak); printf(“n“); else printf(“%5d“,aak); writeDAT(); writeDAT ( ) int aa1000,n, k; FILE *fp; fp=fopen(“out79.dat“,“w“); countValue(aa, for(k=0; k n; k+) if(k+1)%10=0) fprintf(fp,“%5d“,aak); fprintf(fp,“n“); else fprintf (fp,“%5d“,aak)

3、 fclose(fp); 国家三级(数据库技术)机试模拟试卷 79答案与解析 一、程序设计题 1 【正确答案】 void countValue(int *a, int *n) int i; *n=0; for(i=1;i =1000;i+) if(i%7=0 *n-*n+1; /*统计个数 */ a+; else if (i%7 *n=*n+1; /*统计个数 */ a+; 【试题解析】 本题考查的知识点如下: (1)指针的使用。 (2)“%” 运算符。 (3)判断结构中多个条件的布尔运算。 本题中,函数 countValue()以指针为参数,这里就要涉及到指针的使用。 a是指向数组的指针,初始时,指向数组的第一个元素。地址每加 1时,依次指向后面的元素。一个数 a若能被 b整除,则 a除以 b取余得数为 0。能被 7或 11整除,但不 能被 7和 11同时整除,则有两种情况,能被 7整除但不能被 11整除,能被 11整除但不能被 7整除。这里就要用到多个条件的布尔运算。

展开阅读全文
相关资源
猜你喜欢
  • STAS SR EN 10113-2-1995 Hot-rolled proriucts in weldabie fine grain structural steels-Part 2  Delivery conditions for normalized normalized rolled steels《可焊的精细晶粒结构钢的热轧产品.第2部分:标准化 规.pdf STAS SR EN 10113-2-1995 Hot-rolled proriucts in weldabie fine grain structural steels-Part 2 Delivery conditions for normalized normalized rolled steels《可焊的精细晶粒结构钢的热轧产品.第2部分:标准化 规.pdf
  • STAS SR EN 10113-3-1995 Hot rolled products in weldable fine grain structural steels -Part 3  Delivery conditions for thermomechanical rolled steels《可焊的精细晶结构钢热轧产品.第三部分:热机械的轧制钢的交货条件.pdf STAS SR EN 10113-3-1995 Hot rolled products in weldable fine grain structural steels -Part 3 Delivery conditions for thermomechanical rolled steels《可焊的精细晶结构钢热轧产品.第三部分:热机械的轧制钢的交货条件.pdf
  • STAS SR EN 10130-1995 Cold rolled low carbon steel flat products for cold forming Technical delivery conditions《冷轧低碳钢平板产品的冷成形技术的交货条件 》.pdf STAS SR EN 10130-1995 Cold rolled low carbon steel flat products for cold forming Technical delivery conditions《冷轧低碳钢平板产品的冷成形技术的交货条件 》.pdf
  • STAS SR EN 10131-1995 Cold rolled uncoated low carbon and high yield strength steel flat products for cold fbrming - Tolerances on dimonsions and shape《冷轧无涂层低碳钢和高屈服强度钢平板制品的冷成形.尺寸和形.pdf STAS SR EN 10131-1995 Cold rolled uncoated low carbon and high yield strength steel flat products for cold fbrming - Tolerances on dimonsions and shape《冷轧无涂层低碳钢和高屈服强度钢平板制品的冷成形.尺寸和形.pdf
  • STAS SR EN 10143-1994 Continuously hot - dip metal coated steel sheet and strip Tolerances on dimensions and shape《连续热镀钢板和钢带.尺寸和形状公差》.pdf STAS SR EN 10143-1994 Continuously hot - dip metal coated steel sheet and strip Tolerances on dimensions and shape《连续热镀钢板和钢带.尺寸和形状公差》.pdf
  • STAS SR EN 10152-1996 Electrolytically zinc coated cold rolled steel flat products Technlcal delivery conditions《电镀锌冷轧钢板产品.交货技术条件 》.pdf STAS SR EN 10152-1996 Electrolytically zinc coated cold rolled steel flat products Technlcal delivery conditions《电镀锌冷轧钢板产品.交货技术条件 》.pdf
  • STAS SR EN 10155-1995 Structural steele with improved atmospheric corroston resistance - Technical delivery conditions《具有改良大气耐腐蚀性的结构钢.技术交付条件 》.pdf STAS SR EN 10155-1995 Structural steele with improved atmospheric corroston resistance - Technical delivery conditions《具有改良大气耐腐蚀性的结构钢.技术交付条件 》.pdf
  • STAS SR EN 10163-1-1994 Delivery requiremenfs for surface condition of hot rolled steel plates wide flats and sections - Part 1  Genera! requirements《热轧钢板、宽带钢和型钢表面状况交付要求.第1部分:一般 要求.pdf STAS SR EN 10163-1-1994 Delivery requiremenfs for surface condition of hot rolled steel plates wide flats and sections - Part 1 Genera! requirements《热轧钢板、宽带钢和型钢表面状况交付要求.第1部分:一般 要求.pdf
  • STAS SR EN 10163-2-1994 Delivery requirements for surface condition of hot rolled steel plates wide flats and sections - Part 2  Plates and wide flats《热轧钢板、宽带钢和型钢表面状况交付要求.第2部分:钢板和宽.pdf STAS SR EN 10163-2-1994 Delivery requirements for surface condition of hot rolled steel plates wide flats and sections - Part 2 Plates and wide flats《热轧钢板、宽带钢和型钢表面状况交付要求.第2部分:钢板和宽.pdf
  • 相关搜索

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

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