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

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

1、国家三级(网络技术)机试模拟试卷 288及答案与解析 一、程序设计题 1 补充 countValue()函数,函数功能是;选出 5000以下符合条件的自然数。其条件是;千位数与百位数之和等于十位数与个位数之和,并且千位数与百位数之和等于个位数与十位数之差的 10倍。计算并输出这些四位自然数的个数 count以及这些数之和 sum。最后调用函数 WriteData(),把结果 count和 sum输出到 OUT DAT中。 注意;部分源程序已经给出。 请勿改动主函数 Main()中的内容。 试题程序; #include int count, sum; void countValue() void

2、 WriteData() FILE*fp; fp=fopen(“OUT DAT“, “w“); fprintf(fp, “ d n d n“, count, sum); fclose(fp); void main() count=sum=0; countValue(); printf(“满足条件的自然数个数是; d n“, count); printf(“满足条件的自然数个数之和是; d n“, sum); WriteData(); 国家三级(网络技术)机试模拟试卷 288答案与解析 一、程序设计题 1 【正确答案】 int i, thou, hun, ten, data; for(i=5000; i=1000; i-) thou=i 1000; hun=i 1000 100; ten=i 100 10; data=i 10; if(thou+hun=ten+data&thou+hun=(data-ten)*10) count+; sum+=i 【试题解析】 For循环递减遍历 5000 1000之间的数,并且取当前数的千位数字、百位数字、十位数字、个位数字。如果千位加百位等于十位加个位且千位加百位等于个位减去千位乘 10,则计数值 count加 1,并将 i累加到 sum中。

展开阅读全文
相关资源
猜你喜欢
  • AECMA PREN 2865-1993 Aerospace Series Nuts Anchor Self-Locking Floating Two Lug with Counterbore in Heat Resisting Steel MoS2 Lubricated Classification  1 100 MPa (at Ambient Tempe.pdf AECMA PREN 2865-1993 Aerospace Series Nuts Anchor Self-Locking Floating Two Lug with Counterbore in Heat Resisting Steel MoS2 Lubricated Classification 1 100 MPa (at Ambient Tempe.pdf
  • AECMA PREN 2866-1992 Aerospace Series Nuts Anchor Self-Locking Floating One Lug with Counterbore in Steel Cadmium Plated MoS2 Lubricated Classification  1 110 MPa (at Ambient Tempe.pdf AECMA PREN 2866-1992 Aerospace Series Nuts Anchor Self-Locking Floating One Lug with Counterbore in Steel Cadmium Plated MoS2 Lubricated Classification 1 110 MPa (at Ambient Tempe.pdf
  • AECMA PREN 2867-1992 Aerospace Series Nuts Anchor Self-Locking Floating One Lug with Counterbore in Heat Resisting Steel MoS2 Lubricated Classification  1 110 MPa (at Ambient Tempe.pdf AECMA PREN 2867-1992 Aerospace Series Nuts Anchor Self-Locking Floating One Lug with Counterbore in Heat Resisting Steel MoS2 Lubricated Classification 1 110 MPa (at Ambient Tempe.pdf
  • AECMA PREN 2868-1993 Aerospace Series Nuts Hexagonal Slotted Castellated Normal Height Normal Across Flats in Heat Resisting Steel Silver Plated Classification  1 100 MPa (at Ambie.pdf AECMA PREN 2868-1993 Aerospace Series Nuts Hexagonal Slotted Castellated Normal Height Normal Across Flats in Heat Resisting Steel Silver Plated Classification 1 100 MPa (at Ambie.pdf
  • AECMA PREN 2869-1993 Aerospace Series Nuts Hexagonal Slotted Castellated Normal Height Normal Across Flats in Heat Resisting Steel Passivated Classification  1 100 MPa (at Ambient .pdf AECMA PREN 2869-1993 Aerospace Series Nuts Hexagonal Slotted Castellated Normal Height Normal Across Flats in Heat Resisting Steel Passivated Classification 1 100 MPa (at Ambient .pdf
  • AECMA PREN 2870-1990 Aerospace Series Bolts Bihexagonal Normal Head Close Tolerance Normal Shank Short Thread in Titanium Alloy Anodized MoS2 Lubricated Classification 1100 MPa (at.pdf AECMA PREN 2870-1990 Aerospace Series Bolts Bihexagonal Normal Head Close Tolerance Normal Shank Short Thread in Titanium Alloy Anodized MoS2 Lubricated Classification 1100 MPa (at.pdf
  • AECMA PREN 2874-1992 Aerospace Series Bolts Large Bihexagonal Head Close Tolerance Normal Shank Medium Length Thread in Nickel Alloy Passivated Classification  1 550 MPa (at Ambien.pdf AECMA PREN 2874-1992 Aerospace Series Bolts Large Bihexagonal Head Close Tolerance Normal Shank Medium Length Thread in Nickel Alloy Passivated Classification 1 550 MPa (at Ambien.pdf
  • AECMA PREN 2876-1995 Aerospace Series Nuts Hexagon Plain Reduced Height Normal Across Flats in Aluminium Alloy Anodized Classification  450 MPa (at Ambient Temperature) 120 Degrees.pdf AECMA PREN 2876-1995 Aerospace Series Nuts Hexagon Plain Reduced Height Normal Across Flats in Aluminium Alloy Anodized Classification 450 MPa (at Ambient Temperature) 120 Degrees.pdf
  • AECMA PREN 2878-1998 Aerospace Series Nuts Anchor Self-Locking Air Resistant Sealing Floating Two Lug With Counterbore in Alloy Steel Cadmium Plated MoS2 Lubricated Classification .pdf AECMA PREN 2878-1998 Aerospace Series Nuts Anchor Self-Locking Air Resistant Sealing Floating Two Lug With Counterbore in Alloy Steel Cadmium Plated MoS2 Lubricated Classification .pdf
  • 相关搜索

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

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