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

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

1、二级 C语言机试-72 及答案解析(总分:100.00,做题时间:90 分钟)一、填空题(总题数:1,分数:33.00)1.请补充函数 fun(),该函数的功能是:把从主函数中输入的字符串 str2倒置后接在字符串 str1后面。例如:str1=“How do”,str2=“?od uoy”,结果输出:“How do you do?”。注意:部分源程序给出如下。请勿改动主函数 main和其他函数中的任何内容,仅在函数 fun()的横线上填入所编写的若干表达式或语句。试题程序:#includestdio.h#includeconio.h#define N 40void fun(char *str

2、1,char *str2)int i=0,j=0,k=0,n;char ch;char *p1=str1;char *p2=str2;while(*(p1+i)i+;while(*(p2+j)j+;n= 【1】 ;for(;k=j/2;k+,j-)ch=*(p2+k);*(p2+k)=*(p2+j);*(p2+j)=ch;【2】 ;for(; 【3】 ;i+)*(p1+i)=*p2+;*(p1+i)=/0;main()char str1N,str2N;int m,n,k;clrscr();printf(“*Input the string str1 k=j/2;k+,j-)ch=*(p2+k)

3、p2+k)=*(p2+j);*(p2+j)=ch;【2】 ;for(; 【3】 ;i+)*(p1+i)=*p2+;*(p1+i)=/0;main()char str1N,str2N;int m,n,k;clrscr();printf(“*Input the string str1 for(i=0; iN; i+)for(j=0; ji; j+)aij=aij+n /*使数组左下半三角元素中的值加上 n*/ )解析:解析 首先从数组中找出要被加上 n的那部分元素,找的过程其实就是找出将被挑出的那部分元素在原数组中的分布规律的过程。通过观察得出,要被处理的那部分元素的下标值的范围是每行中从第一个元素开始,直到列数等于该行行数时为止。找到这个规律后,依次从数组中取得合乎要求的元素,然后再加上 n。

展开阅读全文
相关资源
猜你喜欢
  • BS ISO IEC 10181-1-1996 Information technology - Open systems interconnection - Security frameworks for open systems - Overview《信息技术 开放式系统互连 开放式系统的安全框架 第1部分 综述》.pdf BS ISO IEC 10181-1-1996 Information technology - Open systems interconnection - Security frameworks for open systems - Overview《信息技术 开放式系统互连 开放式系统的安全框架 第1部分 综述》.pdf
  • BS ISO IEC 10181-2-1996 Information technology - Open systems interconnection - Security frameworks for open systems - Authentication framework《信息技术 开放式系统互连 开放式系统的安全框架 第2部.pdf BS ISO IEC 10181-2-1996 Information technology - Open systems interconnection - Security frameworks for open systems - Authentication framework《信息技术 开放式系统互连 开放式系统的安全框架 第2部.pdf
  • BS ISO IEC 10181-4-1997 Information technology - Open systems interconnection - Security frameworks for open systems - Non-repudiation framework《信息技术 开放系统互连 开放系统用安全帧 非废弃帧》.pdf BS ISO IEC 10181-4-1997 Information technology - Open systems interconnection - Security frameworks for open systems - Non-repudiation framework《信息技术 开放系统互连 开放系统用安全帧 非废弃帧》.pdf
  • BS ISO IEC 10181-7-1996 Information technology - Open systems interconnection - Security frameworks for open systems - Security audit and alarms framework《信息技术 开放式系统互连 开放式.pdf BS ISO IEC 10181-7-1996 Information technology - Open systems interconnection - Security frameworks for open systems - Security audit and alarms framework《信息技术 开放式系统互连 开放式.pdf
  • BS ISO IEC 10206-1991 Information technology - Programming languages - Extended Pascal《信息技术 编程语言 扩展PASCAL语言》.pdf BS ISO IEC 10206-1991 Information technology - Programming languages - Extended Pascal《信息技术 编程语言 扩展PASCAL语言》.pdf
  • BS ISO IEC 10367-1992 Information technology - Standardized coded graphic character sets for use in 8-bit codes《信息技术 8位编码用标准编码字符集》.pdf BS ISO IEC 10367-1992 Information technology - Standardized coded graphic character sets for use in 8-bit codes《信息技术 8位编码用标准编码字符集》.pdf
  • BS ISO IEC 10373-2-2015 Identification cards Test methods Cards with magnetic stripes《识别卡 试验方法 带磁条的卡》.pdf BS ISO IEC 10373-2-2015 Identification cards Test methods Cards with magnetic stripes《识别卡 试验方法 带磁条的卡》.pdf
  • BS ISO IEC 10373-3-2010 Identification cards Test methods Integrated circuit cards with contacts and related interface devices《识别卡 试验方法 接触式集成电路卡及有关的接口装置》.pdf BS ISO IEC 10373-3-2010 Identification cards Test methods Integrated circuit cards with contacts and related interface devices《识别卡 试验方法 接触式集成电路卡及有关的接口装置》.pdf
  • BS ISO IEC 10373-5-2014 Identification cards Test methods Optical memory cards《识别卡 试验方法 光存储卡》.pdf BS ISO IEC 10373-5-2014 Identification cards Test methods Optical memory cards《识别卡 试验方法 光存储卡》.pdf
  • 相关搜索

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

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