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

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

1、三级数据库技术机试-26 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:已知学生的记录由学号和三门学习成绩构成,N 名学生的数据已有入 A 数组中。找出各科及格的学生中总成绩最高的学生记录(假定最高成绩的记录中唯一的),通过形参返回。请考生编写函数 mmm(STUa,STU*s)实现程序的要求,最后调用函数 readwritedat()把结果输出到文件out.dat中。例如:KS01 87 60 88KS09 97 59 99KS11 67 67 60则调用该函数后,输出the top:KS01,87, 60, 88#

2、include stdio.h# include string.h# define N 10void readwritedat ();typedef struct sschar num10;int s1, s2, s3;STU;mmm(STU a,STU *s)main ( )STU aN=“01“, 81, 93, 92,“02“, 89, 65, 91,“03“, 66, 55, 73,“04“, 87, 91, 99,“05“, 77, 65, 91,“06“, 90, 55, 73,“07“, 79, 65, 91,“08“, 61, 55, 73,“09“, 80, 93, 92,“

3、10“, 71, 65, 91m;int i;for (i=0; iN; i+ )printf (“No=%s Mark=%d/n“,ai .num, ai .s1,ai .s2,ai.s3);mmm (a, printf(“the highest: %s,%d/n“,m.num,m.s1+m.s2+m.s3);readwritedat ( );void readwritedat ( )FILE *rf, *wf;STU aN ,m;int i;rf=fopen ( “in. dat“, “r“ );wf=fopen ( “out. dar“, “w“ );for (i=0; i10; i+)

4、fscanf (rf, “%s%d%d%d“, a i .hum, mmm(a, fprintf(wf,“the top: %s,%d,%d,%d/n“,m.num,m.s1,m.s2,m.s3);fclose (rf);fclose (wf);(分数:100.00)_三级数据库技术机试-26 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:已知学生的记录由学号和三门学习成绩构成,N 名学生的数据已有入 A 数组中。找出各科及格的学生中总成绩最高的学生记录(假定最高成绩的记录中唯一的),通过形参返回。请考生编写函数 mmm(

5、STUa,STU*s)实现程序的要求,最后调用函数 readwritedat()把结果输出到文件out.dat中。例如:KS01 87 60 88KS09 97 59 99KS11 67 67 60则调用该函数后,输出the top:KS01,87, 60, 88# include stdio.h# include string.h# define N 10void readwritedat ();typedef struct sschar num10;int s1, s2, s3;STU;mmm(STU a,STU *s)main ( )STU aN=“01“, 81, 93, 92,“02

6、 89, 65, 91,“03“, 66, 55, 73,“04“, 87, 91, 99,“05“, 77, 65, 91,“06“, 90, 55, 73,“07“, 79, 65, 91,“08“, 61, 55, 73,“09“, 80, 93, 92,“10“, 71, 65, 91m;int i;for (i=0; iN; i+ )printf (“No=%s Mark=%d/n“,ai .num, ai .s1,ai .s2,ai.s3);mmm (a, printf(“the highest: %s,%d/n“,m.num,m.s1+m.s2+m.s3);readwrite

7、dat ( );void readwritedat ( )FILE *rf, *wf;STU aN ,m;int i;rf=fopen ( “in. dat“, “r“ );wf=fopen ( “out. dar“, “w“ );for (i=0; i10; i+)fscanf (rf, “%s%d%d%d“, a i .hum, mmm(a, fprintf(wf,“the top: %s,%d,%d,%d/n“,m.num,m.s1,m.s2,m.s3);fclose (rf);fclose (wf);(分数:100.00)_正确答案:(提示:类型:结构体操作。关键点:根据题目条件进行结构体比较和赋值。1遍历结构体数组。2进行条件判断。3计算相关量。4返回结果结构体。解答:mmm(STU a,STU*s)int i;STU h;/*初始化最高记录*/hs1=0; hs2=0; hs3=0;/*遍历所有记录*/for(i=0; i10; i+)/*挑选合格记录*/if(ais1=60&ais2=60&ais3=60)/*更新最高记录*/if(hs1+hs2+hs3ais1+ais2+ais3)h=ai;/*返回最高记录*/*s=h;)解析:

展开阅读全文
相关资源
猜你喜欢
  • KS P ISO 11607-1-2007 Packaging for terminally sterilized medical devices-Part 1:Requirements for materials sterile barrier systems and packaging systems《终端无菌医学设备的包装 第1部分 材料、无菌屏障系统.pdf KS P ISO 11607-1-2007 Packaging for terminally sterilized medical devices-Part 1:Requirements for materials sterile barrier systems and packaging systems《终端无菌医学设备的包装 第1部分 材料、无菌屏障系统.pdf
  • KS P ISO 11607-2-2007 Packaging for terminally sterilized medical devices-Part 2:Validation requirements for forming sealing and assembly processes《终端无菌医学设备的包装 第2部分 成形、密封和装配过程的确认要求.pdf KS P ISO 11607-2-2007 Packaging for terminally sterilized medical devices-Part 2:Validation requirements for forming sealing and assembly processes《终端无菌医学设备的包装 第2部分 成形、密封和装配过程的确认要求.pdf
  • KS P ISO 11609-2012 Dentistry-Dentifrices-Requirements test methods and marking《牙科学 牙膏的要求、试验方法和标志》.pdf KS P ISO 11609-2012 Dentistry-Dentifrices-Requirements test methods and marking《牙科学 牙膏的要求、试验方法和标志》.pdf
  • KS P ISO 11737-1-2012 Sterilization of medical devices-Microbiological methods-Part 1:Determination of population of microorganisms on products《医疗器械的消毒 微生物法 第1部分 产品的微生物群数的判断》.pdf KS P ISO 11737-1-2012 Sterilization of medical devices-Microbiological methods-Part 1:Determination of population of microorganisms on products《医疗器械的消毒 微生物法 第1部分 产品的微生物群数的判断》.pdf
  • KS P ISO 11953-2012 Dentistry-Implants-Clinical performance of hand torque instruments《牙科 植入 手扭矩仪器的临床性能评估》.pdf KS P ISO 11953-2012 Dentistry-Implants-Clinical performance of hand torque instruments《牙科 植入 手扭矩仪器的临床性能评估》.pdf
  • KS P ISO 11979-2-2005 Ophthalmic implants-Intraocular lenses-Part 2:Optical properties and test methods《眼科植入物 眼内晶状体 第2部分 光学特性和测试方法》.pdf KS P ISO 11979-2-2005 Ophthalmic implants-Intraocular lenses-Part 2:Optical properties and test methods《眼科植入物 眼内晶状体 第2部分 光学特性和测试方法》.pdf
  • KS P ISO 11979-6-2006 Ophthalmic implants-Intraocular lenses-Part 6:Shelf-life and transport stability 《眼科植入物 眼内晶状体 第6部分 保存期限和运输稳定性》.pdf KS P ISO 11979-6-2006 Ophthalmic implants-Intraocular lenses-Part 6:Shelf-life and transport stability 《眼科植入物 眼内晶状体 第6部分 保存期限和运输稳定性》.pdf
  • KS P ISO 11979-7-2006 Ophthalmic implants-Intraocular lenses-Part 7:Clinical investigations 《眼科植入物 眼内晶状体 第7部分 临床检测》.pdf KS P ISO 11979-7-2006 Ophthalmic implants-Intraocular lenses-Part 7:Clinical investigations 《眼科植入物 眼内晶状体 第7部分 临床检测》.pdf
  • KS P ISO 11980-2006 Ophthalmic optics-Contact lenses and contact lens care products-Guidance for clinical investigations 《眼科光学 隐形眼镜和隐形眼镜防护产品 临床检测指南》.pdf KS P ISO 11980-2006 Ophthalmic optics-Contact lenses and contact lens care products-Guidance for clinical investigations 《眼科光学 隐形眼镜和隐形眼镜防护产品 临床检测指南》.pdf
  • 相关搜索

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

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