[计算机类试卷]国家三级(网络技术)机试模拟试卷197及答案与解析.doc

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

1、国家三级(网络技术)机试模拟试卷 197及答案与解析 一、程序设计题 1 请编写函数 findValue(int*result, int*amount),其功能是;求出 1到 1000之内能被 7或 11整除但不能同时被 7和 11整除的所有整数并存放在数组 result中,并通过 amount返回这些数的个数。 注意;部分源程序已给出。 请勿改动主函数 main()和写函数 writeData()的内容。 试题程序; #include #include void writeData(); void findValue(int*result, int*amount) void main() i

2、nt result1000, amount, k; system(“CLS“); findValue(result, &amount); printf(“amount= d“, amount); for(k=0; kamount; k+) if(k+1) 10=0) printf(“ 5 d“, resultk); printf(“ n“); else printf(“ 5d“, resultk); writeData(); void writeData() int result1000, amount, k; FILE*fp; fp=fopen(“OUT DAT“, “w“); findVa

3、lue(result, &amount); for(k=0; kamount; k+) if(k+1) 10=0) fprintf(fp, “ 5d“, resultk); fprintf(fp, “ n“); else fprintf(fp, “ 5d“, resultk); fclose(fp); 国家三级(网络技术)机试模拟试卷 197答案与解析 一、程序设计题 1 【正确答案】 void findValue(int*result。 int*amount) int i; *amount=0;将计数器清零 for(i=1; i=1000; i+) 在 1 1000中循环 if(i 7=0&i 11!=0)|(i 11=0&i 7!=0) 如果满足条件 result*amount=i;将数据放人数组 result中的第 *amount位 (*amount)+; 计数器加 1 【试题解析】 若一个数 m能被 n 整除,则有 m n=0。另外本题也考查了通过指针传递数据的方法。主函数将所要求子函数返回的变量的指针 *result, *amount传给子函数,子函数通过对指针的操作 直接将数据传到变量当中,这也为子函数返回多值提供了一种方法。

展开阅读全文
相关资源
猜你喜欢
  • BS PD CEN TR 16674-2014 Information technology RFID privacy impact assessment analysis for specific sectors《信息技术 特定行业用射频识别隐私影响分析》.pdf BS PD CEN TR 16674-2014 Information technology RFID privacy impact assessment analysis for specific sectors《信息技术 特定行业用射频识别隐私影响分析》.pdf
  • BS PD CEN TR 16676-2014 Energy losses by industrial door《工业门的能量损失》.pdf BS PD CEN TR 16676-2014 Energy losses by industrial door《工业门的能量损失》.pdf
  • BS PD CEN TR 16680-2014 Liquid petroleum products Investigation on internal diesel injector sticking deposits mechanisms and the impacts of corrosion inhibitors《液化石油产品 内部柴.pdf BS PD CEN TR 16680-2014 Liquid petroleum products Investigation on internal diesel injector sticking deposits mechanisms and the impacts of corrosion inhibitors《液化石油产品 内部柴.pdf
  • BS PD CEN TR 16684-2014 Information technology Notification of RFID Additional information to be provided by operators《信息技术 射频识别通知 运营商提供的附加信息》.pdf BS PD CEN TR 16684-2014 Information technology Notification of RFID Additional information to be provided by operators《信息技术 射频识别通知 运营商提供的附加信息》.pdf
  • BS PD CEN TR 16690-2014 Electronic fee collection Guidelines for EFC applications based on in-vehicle ITS stations《电子收费 基于车载智能运输系统站的电子收费应用程序指南》.pdf BS PD CEN TR 16690-2014 Electronic fee collection Guidelines for EFC applications based on in-vehicle ITS stations《电子收费 基于车载智能运输系统站的电子收费应用程序指南》.pdf
  • BS PD CEN TR 16699-2014 Foodstuffs Determination of pesticide residues by GC-MS MS Tandem mass spectrometric parameters《食品 利用气相色谱-质谱联用 质谱法 (GC-MS MS) 测定农药残留物 串联质谱参数》.pdf BS PD CEN TR 16699-2014 Foodstuffs Determination of pesticide residues by GC-MS MS Tandem mass spectrometric parameters《食品 利用气相色谱-质谱联用 质谱法 (GC-MS MS) 测定农药残留物 串联质谱参数》.pdf
  • BS PD CEN TR 16705-2014 Perimeter protection Performance classification methodology《周边防护 性能分类方法》.pdf BS PD CEN TR 16705-2014 Perimeter protection Performance classification methodology《周边防护 性能分类方法》.pdf
  • BS PD CEN TR 16706-2014 Postal Services Quality of Service Measurement of incorrect delivery Feasibility Report《邮政业务 服务质量 不正确传递的测量 可行性报告》.pdf BS PD CEN TR 16706-2014 Postal Services Quality of Service Measurement of incorrect delivery Feasibility Report《邮政业务 服务质量 不正确传递的测量 可行性报告》.pdf
  • BS PD CEN TR 16710-1-2015 Ergonomics methods Feedback method A method to understand how end users perform their work with machines《人类工效学方法 反馈方法 理解终端用户如何使用机器实施工作的方法》.pdf BS PD CEN TR 16710-1-2015 Ergonomics methods Feedback method A method to understand how end users perform their work with machines《人类工效学方法 反馈方法 理解终端用户如何使用机器实施工作的方法》.pdf
  • 相关搜索

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

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