[计算机类试卷]计算机三级网络技术机试(上机操作)模拟试卷64及答案与解析.doc

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

1、计算机三级网络技术机试(上机操作)模拟试卷 64及答案与解析 一、程序设计题 1 已知在文件 IN DAT中存有 100个产品销售记录,每个产品销售记录有产品代码 dm(字符型 4位 )、产品名称 mc(字符型 10位 )、单价 dj(整型 )、数量 s1(整型 )、金额 je(长整型 )五部分组成。其中:金额 =单价 *数量计算得出。函数 ReadDat()是读取这 100个销售记录并存人结构数组 sell中。请编制函数 SortDat(),其功能要求:按金额从小到大进行排列,若金额相同,则按产品代码从大到小进行排列,最终结构仍存入结构数组 sell中,最后调用函数 WriteDat()把结

2、构输出到文件OUT2 DAT中。 注意:部分源程序已给出。 请勿改动主函数 main()、读数据函数 ReadDat()和输出数据函数 WriteDat()的内容。 试题程序: #include #include #include #include #define MAX 100 typedef struct char dm5;产品代码 char moill;产品名称 int dj;单价 int sl;数量 long je; 金额 PRO; PRO sellMAX; void ReadDat(); void WriteDat(); void SortDat() void main() mems

3、et(sell, 0, sizeof(sell); ReadDat(); SortDat(); WriteDat(); void ReadDat() FILE*fp; char str80, ch11; int i; fp=fopen(“IN DAT”, “r”); for(i=0; isellj je (selli je=sellj je strcmp(selli dm, sellj dm)0) *将以 selli为起始地址大小为 sizeof (temp)的内存中的内容 复制到以 temp为起始地址的内存中 * memepy( temp selli, sizeof(temp); memep

4、y(&selli, sellj, sizeof(temp); memepy( sellj, 8 temp, sizeof(temp); 【试题解析】 本题主要考查结构数组排序的问题。 所谓结构数组排序就是以结构某一元素为依据对结构数组进行排序。排序的思想是 (以从小到大为例 ):将当前数据与其后的各个数据相比较。如果当前的数据比其后的数据大,则将两数据进行交换,从而使得前面的数据小于后面的数据,达到从小到大排序的目的。由于结构不像变量那样可以通过简单的赋值来交换变量(如果要赋值的话需要对结构里的所有元素进行赋值替换,比较麻烦 ),所以在进行两个相邻结构交换时,用到 内存拷贝函数来对内存的内容整体进行操作。

展开阅读全文
相关资源
猜你喜欢
  • BS ISO 8013-2012 en_1116  Rubber vulcanized Determination of creep in compression or shear《硫化橡胶 压缩或剪切蠕变的测定》.pdf BS ISO 8013-2012 en_1116 Rubber vulcanized Determination of creep in compression or shear《硫化橡胶 压缩或剪切蠕变的测定》.pdf
  • BS ISO 8018-2007 en_4981  Tools for moulding - Guide bushes headed and locating guide bushes headed《模制工具.有头的导套和有头的定位导套》.pdf BS ISO 8018-2007 en_4981 Tools for moulding - Guide bushes headed and locating guide bushes headed《模制工具.有头的导套和有头的定位导套》.pdf
  • BS ISO 8020-2002 en_2690  Tools for pressing - Punches with cylindrical head and straight or reduced shank《压制加工用工具.带圆头和直的或缩小柄杆的冲头》.pdf BS ISO 8020-2002 en_2690 Tools for pressing - Punches with cylindrical head and straight or reduced shank《压制加工用工具.带圆头和直的或缩小柄杆的冲头》.pdf
  • BS ISO 8036-2015 en_9407  Microscopes Immersion liquids for light microscopy《显微镜.光学显微学的浸液》.pdf BS ISO 8036-2015 en_9407 Microscopes Immersion liquids for light microscopy《显微镜.光学显微学的浸液》.pdf
  • BS ISO 8038-2013 en_5299  Microscopes Screw threads for objectives and related nosepieces《显微镜.物镜及物镜座螺纹》.pdf BS ISO 8038-2013 en_5299 Microscopes Screw threads for objectives and related nosepieces《显微镜.物镜及物镜座螺纹》.pdf
  • BS ISO 8040-2001 en_6291  Optics and optical instruments - Microscopes - Dimensions of tube slide and tube slot connections《光学和光学仪器.显微镜.镜筒导板和镜筒槽连接件尺寸》.pdf BS ISO 8040-2001 en_6291 Optics and optical instruments - Microscopes - Dimensions of tube slide and tube slot connections《光学和光学仪器.显微镜.镜筒导板和镜筒槽连接件尺寸》.pdf
  • BS ISO 8051-2016 en_5555  Long shank taps with nominal diameters from M3 to M10 Full-diameter shank taps with recess《标称直径从M3至M10的长柄丝锥.带凹槽的直径柄丝锥》.pdf BS ISO 8051-2016 en_5555 Long shank taps with nominal diameters from M3 to M10 Full-diameter shank taps with recess《标称直径从M3至M10的长柄丝锥.带凹槽的直径柄丝锥》.pdf
  • BS ISO 8058-1999 en_1067  Air cargo Insulated containers Thermal efficiency requirements《航空货运.隔热集装箱.热效率要求》.pdf BS ISO 8058-1999 en_1067 Air cargo Insulated containers Thermal efficiency requirements《航空货运.隔热集装箱.热效率要求》.pdf
  • BS ISO 8066-2-2001 en_5633  Rubber and plastics hoses and hose assemblies for automotive air conditioning - Specification - Refrigerant 134a《汽车空调器用橡胶和塑料软管及软管配件.规格.制冷剂134a》.pdf BS ISO 8066-2-2001 en_5633 Rubber and plastics hoses and hose assemblies for automotive air conditioning - Specification - Refrigerant 134a《汽车空调器用橡胶和塑料软管及软管配件.规格.制冷剂134a》.pdf
  • 相关搜索

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

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