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

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

1、三级信息管理技术机试-216 及答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:设 A,B,C 为三个不为零的正整数,计算并输出下列不定方程组解的个数 cnt 以及满足此条件的所有 A,B,C 之和 sum。不定方程组为:A+B+C=13A-C=5请编写函数 countValue()实现程序的要求,最后调用函数 writeDat()把结果 cnt 和 sum 输出到文件out.dat 中。试题源程序#includestdiohvoid WriteDat();int cnt,sum:void countvalue()void

2、main()cnt=sum=0:countvalue();printf(“cnt=%d/n“,cnt);printf(“sum=%d/n“,sum);WriteDat();void WriteDat()FILE*fp;fp=fopen(“outdat“,“w“);fprintf(fp,“%d/n%d/n“,cnt,sum);fclose(fp);(分数:100.00)_三级信息管理技术机试-216 答案解析(总分:100.00,做题时间:90 分钟)一、上机题(总题数:1,分数:100.00)1.下列程序的功能是:设 A,B,C 为三个不为零的正整数,计算并输出下列不定方程组解的个数 cnt

3、以及满足此条件的所有 A,B,C 之和 sum。不定方程组为:A+B+C=13A-C=5请编写函数 countValue()实现程序的要求,最后调用函数 writeDat()把结果 cnt 和 sum 输出到文件out.dat 中。试题源程序#includestdiohvoid WriteDat();int cnt,sum:void countvalue()void main()cnt=sum=0:countvalue();printf(“cnt=%d/n“,cnt);printf(“sum=%d/n“,sum);WriteDat();void WriteDat()FILE*fp;fp=fop

4、en(“outdat“,“w“);fprintf(fp,“%d/n%d/n“,cnt,sum);fclose(fp);(分数:100.00)_正确答案:(void countvalue()int a:for(a=6;a13;a+)if(18-2*a0)cnt+:sum+=13:)解析:解析 本题主要考查的是解方程问题。本题的难点和解题的关键在于分析题目,对于给定的方程组变形得到 B=18-2*A,C=A-50,因此 A 从 6 开始可能满足方程,而由第一个方程知道 A 不可能大于13,因此我们可以用 for 循环内嵌 if 语句来解出方程,如果 B0,那么此时的 A 就满足该方程组,cnt增 1,并且由第一个方程知道有一组解 sum 的值增加 13。

展开阅读全文
相关资源
猜你喜欢
  • ITU-T Q 2631 1 SPANISH-2003 IP connection control signalling protocol C Capability Set 1《IP连接控制信令协议能力集1 系列Q 交换和信令 宽带综合业务数字网(ISDN) 接入信令和网络信令和互通的宽带综合业务数字网(B-ISDN)应用协议的共同点 11号.pdf ITU-T Q 2631 1 SPANISH-2003 IP connection control signalling protocol C Capability Set 1《IP连接控制信令协议能力集1 系列Q 交换和信令 宽带综合业务数字网(ISDN) 接入信令和网络信令和互通的宽带综合业务数字网(B-ISDN)应用协议的共同点 11号.pdf
  • ITU-T Q 2631 1-2003 IP connection control signalling protocol C Capability Set 1 SERIES Q SWITCHING AND SIGNALLING Broadband ISDN C Common aspects of B-ISDN application protocols fnd .pdf ITU-T Q 2631 1-2003 IP connection control signalling protocol C Capability Set 1 SERIES Q SWITCHING AND SIGNALLING Broadband ISDN C Common aspects of B-ISDN application protocols fnd .pdf
  • ITU-T Q 2632 1 FRENCH-2003 Interworking between AAL type 2 signalling protocol Capability Set 2 and IP connection control signalling protocol Capability Set 1《AAL(ATM适配层)类型2信令能力集2和.pdf ITU-T Q 2632 1 FRENCH-2003 Interworking between AAL type 2 signalling protocol Capability Set 2 and IP connection control signalling protocol Capability Set 1《AAL(ATM适配层)类型2信令能力集2和.pdf
  • ITU-T Q 2632 1 SPANISH-2003 Interworking between AAL type 2 signalling protocol Capability Set 2 and IP connection control signalling protocol Capability Set 1《AAL(ATM适配层)类型2信令能力集2.pdf ITU-T Q 2632 1 SPANISH-2003 Interworking between AAL type 2 signalling protocol Capability Set 2 and IP connection control signalling protocol Capability Set 1《AAL(ATM适配层)类型2信令能力集2.pdf
  • ITU-T Q 2632 1-2003 Interworking between AAL Type 2 Signalling Protocol Capability Set 2 and IP Connection Control Signalling Protocol Capability Set 1 SERIES Q SWITCHING AND SIGNADN .pdf ITU-T Q 2632 1-2003 Interworking between AAL Type 2 Signalling Protocol Capability Set 2 and IP Connection Control Signalling Protocol Capability Set 1 SERIES Q SWITCHING AND SIGNADN .pdf
  • ITU-T Q 2650 FRENCH-1999 Interworking between signalling system No 7 broadband ISDN user part (B-ISUP) and digital subscriber signalling system No 2 (DSS2)《NO 7信令系统宽带综合业务数字网(ISDN)用.pdf ITU-T Q 2650 FRENCH-1999 Interworking between signalling system No 7 broadband ISDN user part (B-ISUP) and digital subscriber signalling system No 2 (DSS2)《NO 7信令系统宽带综合业务数字网(ISDN)用.pdf
  • ITU-T Q 2650 SPANISH-1999 Interworking between signalling system No 7 broadband ISDN user part (B-ISUP) and digital subscriber signalling system No 2 (DSS2)《NO 7信令系统宽带综合业务数字网(ISDN).pdf ITU-T Q 2650 SPANISH-1999 Interworking between signalling system No 7 broadband ISDN user part (B-ISUP) and digital subscriber signalling system No 2 (DSS2)《NO 7信令系统宽带综合业务数字网(ISDN).pdf
  • ITU-T Q 2650-1999 Interworking between Signalling System No 7 Broadband ISDN User Part (B-ISUP) and Digital Subscriber Signalling System No 2 (DSS2) Series Q Switching and SignalliApp.pdf ITU-T Q 2650-1999 Interworking between Signalling System No 7 Broadband ISDN User Part (B-ISUP) and Digital Subscriber Signalling System No 2 (DSS2) Series Q Switching and SignalliApp.pdf
  • ITU-T Q 2660 FRENCH-1999 Interworking between signalling system No 7 broadband ISDN user part (B-ISUP) and narrow-band ISDN user part (N-ISUP)《NO 7信令系统宽带综合业务数字网(ISDN)用户部分(B-综合业务数字网.pdf ITU-T Q 2660 FRENCH-1999 Interworking between signalling system No 7 broadband ISDN user part (B-ISUP) and narrow-band ISDN user part (N-ISUP)《NO 7信令系统宽带综合业务数字网(ISDN)用户部分(B-综合业务数字网.pdf
  • 相关搜索

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

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