【计算机类职业资格】二级C语言机试-165及答案解析.doc

上传人:Iclinic170 文档编号:1325670 上传时间:2019-10-17 格式:DOC 页数:6 大小:31KB
下载 相关 举报
【计算机类职业资格】二级C语言机试-165及答案解析.doc_第1页
第1页 / 共6页
【计算机类职业资格】二级C语言机试-165及答案解析.doc_第2页
第2页 / 共6页
【计算机类职业资格】二级C语言机试-165及答案解析.doc_第3页
第3页 / 共6页
【计算机类职业资格】二级C语言机试-165及答案解析.doc_第4页
第4页 / 共6页
【计算机类职业资格】二级C语言机试-165及答案解析.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、二级 C语言机试-165 及答案解析(总分:100.00,做题时间:90 分钟)一、填空题(总题数:1,分数:33.00)1.str是全部由小写字母字符和空格字符组成的字符串,由 num 传入字符串的长度。请补充函数 fun(),该函数的功能是:统计字符串 str中的单词个数,结果由变量 num传回。每个单词之间都由空格隔开,并且字符串 str开始不存在空格。例如:str=“how do you do”,结果为:num=4。注意:部分源程序给出如下。请勿改动主函数 main和其他函数中的任何内容,仅在函数 fun()的横线上填入所编写的若干表达式或语句。试题程序:#includestdio.h

2、define N 80void fun(char *s,int *num)int i,n=0;for(i=0; 【1】 ;i+)if(si=a, fun(str,t+=j/i;return t;main()int m;clrscr();printf(“/nPlease enter 1 integer number:“);scanf(“%d“, fun(str,t+=j/i;return t;main()int m;clrscr();printf(“/nPlease enter 1 integer number:“);scanf(“%d“,i=1000;i+) /*求 1到 1000之内能被 5或 13整除、但不能同时被 5和 13整除的所有整数,并放入数组 a中*/if(i%5=0|i%13=0) /*传回满足条件的数的个数*/)解析:解析 注意本题题目是找出能被 5或 13整除但不能同时被 5和 13整除的所有整数。能同时被 5和 13整除的整数一定能被 65整除,且不能被 65整除的数不一定就是能被 5或 13整除的数。所以可得出程序中的 if()。按运算优先级可知 (i%5=0|i%13=0),注意,两边必须要有小括号。

展开阅读全文
相关资源
猜你喜欢
  • GOST R 8 821-2013 State system for ensuring the uniformity of measurements Instruments for measurement of pulsation coefficient Verification procedure《确保测量一致性的国家系统 脉动系数测量仪器 验证程序》.pdf GOST R 8 821-2013 State system for ensuring the uniformity of measurements Instruments for measurement of pulsation coefficient Verification procedure《确保测量一致性的国家系统 脉动系数测量仪器 验证程序》.pdf
  • GOST R 8 822-2013 State system for ensuring the uniformity of measurements The determination of the corrective factor on get fat capacity carrying oil tank court at measurement of ion《.pdf GOST R 8 822-2013 State system for ensuring the uniformity of measurements The determination of the corrective factor on get fat capacity carrying oil tank court at measurement of ion《.pdf
  • GOST R 8 823-2013 State system for ensuring the uniformity of measurements Meters for hot water General metrological and technical requirements《确保测量一致性的国家系统 热水表 通用计量和技术要求》.pdf GOST R 8 823-2013 State system for ensuring the uniformity of measurements Meters for hot water General metrological and technical requirements《确保测量一致性的国家系统 热水表 通用计量和技术要求》.pdf
  • GOST R 8 824-2013 State system for ensuring the uniformity of measurements General requirements for the competence of reference material producers《确保测量一致性的国家系统 标准样品生产者能力的通用要求》.pdf GOST R 8 824-2013 State system for ensuring the uniformity of measurements General requirements for the competence of reference material producers《确保测量一致性的国家系统 标准样品生产者能力的通用要求》.pdf
  • GOST R 8 825-2013 State system for ensuring the uniformity of measurements Intelligent Sensors and Intelligent Measuring Systems Methods of accelerated tests《确保测量一致性的国家系统 智能传感器和智能测.pdf GOST R 8 825-2013 State system for ensuring the uniformity of measurements Intelligent Sensors and Intelligent Measuring Systems Methods of accelerated tests《确保测量一致性的国家系统 智能传感器和智能测.pdf
  • GOST R 8 826-2013 State system for ensuring the uniformity of measurements State verification schedule for measuring instruments of the amplitude of the ultrasonic displacement andsoli.pdf GOST R 8 826-2013 State system for ensuring the uniformity of measurements State verification schedule for measuring instruments of the amplitude of the ultrasonic displacement andsoli.pdf
  • GOST R 8 827-2013 State system for ensuring the uniformity of measurements Method of measuring and specifying Colour Rendering Index of light sources《确保测量一致性的国家系统 光源显色指数的测量和描述方法》.pdf GOST R 8 827-2013 State system for ensuring the uniformity of measurements Method of measuring and specifying Colour Rendering Index of light sources《确保测量一致性的国家系统 光源显色指数的测量和描述方法》.pdf
  • GOST R 8 828-2013 State systems for ensuring the uniformity of measurements Method of measurement of spectral diffuse reflectance of photovoltaic elements and solar collectors at ao 8.pdf GOST R 8 828-2013 State systems for ensuring the uniformity of measurements Method of measurement of spectral diffuse reflectance of photovoltaic elements and solar collectors at ao 8.pdf
  • GOST R 8 829-2013 State system for ensuring the uniformity of measurements Method for the determination of optical density (transmittance coefficient) and haze of polymeric plates .pdf GOST R 8 829-2013 State system for ensuring the uniformity of measurements Method for the determination of optical density (transmittance coefficient) and haze of polymeric plates .pdf
  • 相关搜索

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

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