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

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

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

2、) void 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); WriteI)ata(); 计算机三级网络技术机试(上机操作)模拟试卷 34答案与解析 一、程序设计题 1 【正确答案】 int itthou, hun, ten, datal for(i=5000; i=1000; i-) thou=i 1000; hun=i looo 100; ten=i 100 10; data=i 10; if(thou+hun=ten+data thou+hun=(da taten)*10) count+; sum+=i 【试题解析】 For循环递减遍历 5000 1000之间的数,并且取当前数的千位数字、百位数字、十位数字、个位数字。如果千位加百位等于十位加个位且千位加百位等于个位减去千位乘 10,则计数值 count加 1,并将 i累加到 sum中。

展开阅读全文
相关资源
猜你喜欢
  • STAS SR ISO 8502-4-1995 Preparation of steel substrates before application of paint and related products -Tests for the assessment of surface cleanliness - Part 4 Guidance on the e.pdf STAS SR ISO 8502-4-1995 Preparation of steel substrates before application of paint and related products -Tests for the assessment of surface cleanliness - Part 4 Guidance on the e.pdf
  • STAS SR ISO 8503-1-1995 Preparation of steel substrates before application of paints and related products -Surface roughness characteristics of blast-cleaned steel substrates《在喷涂油漆.pdf STAS SR ISO 8503-1-1995 Preparation of steel substrates before application of paints and related products -Surface roughness characteristics of blast-cleaned steel substrates《在喷涂油漆.pdf
  • STAS SR ISO 8503-2-1995 Preparation of steei substrates before application of paints and related products - Surface roughness charactaristics of blast-cleaned steel substrates -《在喷.pdf STAS SR ISO 8503-2-1995 Preparation of steei substrates before application of paints and related products - Surface roughness charactaristics of blast-cleaned steel substrates -《在喷.pdf
  • STAS SR ISO 8503-3-1996 Preparation of steel substrates before application of paints and related products -Surface roughness characteristics of blast-cleaned steel substrates - 《在喷.pdf STAS SR ISO 8503-3-1996 Preparation of steel substrates before application of paints and related products -Surface roughness characteristics of blast-cleaned steel substrates - 《在喷.pdf
  • STAS SR ISO 8503-4-1995 Preparation of steel substrates before applicatton of paints and related products - Surface roughness characteristics of blast-cleaned.steel substrates -《在喷.pdf STAS SR ISO 8503-4-1995 Preparation of steel substrates before applicatton of paints and related products - Surface roughness characteristics of blast-cleaned.steel substrates -《在喷.pdf
  • STAS SR ISO 8504-3-1996 Preparation of steel substrates before application of paints and related products - Surface preparation methods -Part 3 Hand-and power-tool cleaning《在喷涂油漆和相.pdf STAS SR ISO 8504-3-1996 Preparation of steel substrates before application of paints and related products - Surface preparation methods -Part 3 Hand-and power-tool cleaning《在喷涂油漆和相.pdf
  • STAS SR ISO 8512-1-1994 Surface plates — Part 1 Cast iron《表面板 第1部分:铸铁 》.pdf STAS SR ISO 8512-1-1994 Surface plates — Part 1 Cast iron《表面板 第1部分:铸铁 》.pdf
  • STAS SR ISO 8512-2-1994 Surface plates — Part 2 Granite《表面板 第2部分:花岗岩 》.pdf STAS SR ISO 8512-2-1994 Surface plates — Part 2 Granite《表面板 第2部分:花岗岩 》.pdf
  • STAS SR ISO 8523-1995 Microbiology - General guidance for the detection of Enterobacteriaceae with pre-enrichment《微生物 预浓缩肠杆菌族检验的一般指南 》.pdf STAS SR ISO 8523-1995 Microbiology - General guidance for the detection of Enterobacteriaceae with pre-enrichment《微生物 预浓缩肠杆菌族检验的一般指南 》.pdf
  • 相关搜索

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

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