【计算机类职业资格】三级信息管理技术机试-217及答案解析.doc

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

1、三级信息管理技术机试-217 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:已知学生的记录由学号和学习成绩构成,N 名学生的数据已存入 a 数组中。找出成绩最高的学生记录(假定最高成绩的记录是唯一的),通过形参返回。请编写函数 mmm(STU a,STU*s)实现程序要求,最后调用函数 reawriteDAT()把结果输出到文件 out.dat 中。例如:KS01 87KS09 67KS11 97则调用该函数后,输出 The lowest:KS09,67。注意:部分源程序已给出。请勿改动主函数 main()和函数 rea

2、dwriteDAT()的内容。试题源程序#includestdioh#includestringh#includeconioh#define N 10void readwriteDat();typedef struct sschar num10;int s;STU;void mmm(STU a 口,STU*s)main()(STU aN=“A01“,81,“A02“,89,“A03“,81),“A04“,66),“A05“,87),“A06“,77),“A07“,79,“A08“,61,“A09“,80),“A10“,71),m;int i;system(“cls“);printf(“*The

3、 original data*/n“);for(i=0;iN;i+)printf(“No=%s Mark=%d/n“,ainmu/n,ais);mmm(a,wf=fopen(“outdat“,“w“);for(i:0;i10;i+)fscanf(rf,“%s%d“,ainum,ais);mmm(a,m);fprintf(wf,“The lowest:%s,%d/n“,m.num,ms);fclose(rf);fclose(wf);(分数:100.00)_三级信息管理技术机试-217 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功

4、能是:已知学生的记录由学号和学习成绩构成,N 名学生的数据已存入 a 数组中。找出成绩最高的学生记录(假定最高成绩的记录是唯一的),通过形参返回。请编写函数 mmm(STU a,STU*s)实现程序要求,最后调用函数 reawriteDAT()把结果输出到文件 out.dat 中。例如:KS01 87KS09 67KS11 97则调用该函数后,输出 The lowest:KS09,67。注意:部分源程序已给出。请勿改动主函数 main()和函数 readwriteDAT()的内容。试题源程序#includestdioh#includestringh#includeconioh#define N

5、 10void readwriteDat();typedef struct sschar num10;int s;STU;void mmm(STU a 口,STU*s)main()(STU aN=“A01“,81,“A02“,89,“A03“,81),“A04“,66),“A05“,87),“A06“,77),“A07“,79,“A08“,61,“A09“,80),“A10“,71),m;int i;system(“cls“);printf(“*The original data*/n“);for(i=0;iN;i+)printf(“No=%s Mark=%d/n“,ainmu/n,ais);

6、mmm(a,wf=fopen(“outdat“,“w“);for(i:0;i10;i+)fscanf(rf,“%s%d“,ainum,ais);mmm(a,m);fprintf(wf,“The lowest:%s,%d/n“,m.num,ms);fclose(rf);fclose(wf);(分数:100.00)_正确答案:(void mmm(STU a,STU*s)int i:s-s=a0s;for(i=1;iN;i+)if(aiss-s)*s=ai;)解析:解析 本题考查的是查询最小值问题。本题的关键在于结构体变量的使用以及指针的使用,结构体的成员变量为 ais 而结构体指针的成员变量为 s-s。用一个 for 循环遍历结构体数组 a 中的结构体,内嵌 if 语句使指针 s 指向扫描过所有结构体中成员变量 s 最小的结构体,这样遍历完所有的结构体后,指针 s 就指向结构体成员变量 s 最小的结构体。

展开阅读全文
相关资源
猜你喜欢
  • BS EN 1965-2-2011 Structural adhesives Corrosion Determination and classification of corrosion to a brass substrate《结构胶粘剂 腐蚀 黄铜衬底腐蚀性测定和分类》.pdf BS EN 1965-2-2011 Structural adhesives Corrosion Determination and classification of corrosion to a brass substrate《结构胶粘剂 腐蚀 黄铜衬底腐蚀性测定和分类》.pdf
  • BS EN 1966-2009 Structural adhesives - Characterization of a surface by measuring adhesion by means of the three point bending method《机构粘合剂 用三点弯曲法测量粘附性的方法进行表面特性的表征》.pdf BS EN 1966-2009 Structural adhesives - Characterization of a surface by measuring adhesion by means of the three point bending method《机构粘合剂 用三点弯曲法测量粘附性的方法进行表面特性的表征》.pdf
  • BS EN 1968-2002 Transportable gas cylinders - Periodic inspection and testing of seamless steel gas cylinders《可运输储气瓶 无缝钢储气瓶的周期性检验和测试》.pdf BS EN 1968-2002 Transportable gas cylinders - Periodic inspection and testing of seamless steel gas cylinders《可运输储气瓶 无缝钢储气瓶的周期性检验和测试》.pdf
  • BS EN 1969-2000 Surfaces for sports areas - Determination of thickness of synthetic sports surfaces《运动场表面 人造运动场表面合成物厚度的测定》.pdf BS EN 1969-2000 Surfaces for sports areas - Determination of thickness of synthetic sports surfaces《运动场表面 人造运动场表面合成物厚度的测定》.pdf
  • BS EN 197-1-2011 Cement Composition specifications and conformity criteria for common cements《水泥 普通水泥的构成 规范和符合性准则》.pdf BS EN 197-1-2011 Cement Composition specifications and conformity criteria for common cements《水泥 普通水泥的构成 规范和符合性准则》.pdf
  • BS EN 197-2-2014 Cement Conformity evaluation《水泥 合格评定》.pdf BS EN 197-2-2014 Cement Conformity evaluation《水泥 合格评定》.pdf
  • BS EN 1971-1-2011 Copper and copper alloys Eddy current test for measuring defects on seamless round copper and copper alloy tubes Test with an encircling test coil on the outer su.pdf BS EN 1971-1-2011 Copper and copper alloys Eddy current test for measuring defects on seamless round copper and copper alloy tubes Test with an encircling test coil on the outer su.pdf
  • BS EN 1971-2-2011 Copper and copper alloys Eddy current test for measuring defects on seamless round copper and copper alloy tubes Test with an internal probe on the inner surface《.pdf BS EN 1971-2-2011 Copper and copper alloys Eddy current test for measuring defects on seamless round copper and copper alloy tubes Test with an internal probe on the inner surface《.pdf
  • BS EN 1976-2012 Copper and copper alloys Cast unwrought copper product《铜和铜合金 未最后成形的铜铸件产品》.pdf BS EN 1976-2012 Copper and copper alloys Cast unwrought copper product《铜和铜合金 未最后成形的铜铸件产品》.pdf
  • 相关搜索

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

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