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

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

1、国家三级(网络技术)机试模拟试卷 278及答案与解析 一、程序设计题 1 请编制函数 moveChar(char*s),其功能是;把 S字符串中偶数位的字符左移到其相邻的偶数位上,偶数位的第一个字符移到最后一个偶数位上。奇数位的字符右移到与其相邻的奇数位上,奇数位的最后一个字符移到第一个奇数位上。函数readWriteData()负责读人文件 IN DAT中的数据,并把结果输出到 OUT DAT文件中。 例如; S字符串中原有内容为 abcdefg,则调用该函数后,结果为 gdafcbe。 注意;部分源程序已给出。 请勿改动主函数 main()和输出函数 readWriteData()的内容。

2、 试题程序; #include #include #include #define N 81 void readWriteData(); void moveChar(char*s) void main() char inputN; int i; for(i=0; i1; i-=2) *(s+i-1)=*(s+i-1-2); 奇数位右移 *s=temp1; 将奇数位的最后一位放到奇数队列的首位 for(i=2; i1; i-=2) *(x+i-1)=*(s+i-1-2); 奇数位右移 *s=temp1; 将奇数位的最后一位放到奇数队列的首位 for(i=2; ilen-1; i+=2) *(s+i-1)=*(s+i-1+2); 将偶数位左移 *(s+len-2)=temp0; 将偶数位的首位放到偶数队列的末位 【试题解析】 本题主要考查利用指针对字符串中字符进行移动。基本步骤是;1分别将偶数位的头一位和 奇数位的最后一位保存; 2利用指针,分别对数组中的奇数位和偶数位进行赋值移动; 3将保存起来的值放到移动后的留下的位置处。

展开阅读全文
相关资源
猜你喜欢
  • AECMA PREN 3478-1988 Aerospace Series Steel FE-PM63 Solution Annealed Transformation Treated and Precipitation Hardened 1310 Less Than or Equal to Rm Less Than or Equal to 1550 MPas.pdf AECMA PREN 3478-1988 Aerospace Series Steel FE-PM63 Solution Annealed Transformation Treated and Precipitation Hardened 1310 Less Than or Equal to Rm Less Than or Equal to 1550 MPas.pdf
  • AECMA PREN 3479-2000 Aerospace Series Steel FE-PM1802 (X5CrNiCu15-5) Consumable Electrode Remelted Solution Treated and Precipitation Treated Plate 6 mm Less Than or Equal to a LesE.pdf AECMA PREN 3479-2000 Aerospace Series Steel FE-PM1802 (X5CrNiCu15-5) Consumable Electrode Remelted Solution Treated and Precipitation Treated Plate 6 mm Less Than or Equal to a LesE.pdf
  • AECMA PREN 3480-2006 Aerospace series Steel FE-PA3601 (X6CrNiTi18-10) Air melted Softened Plate 6 mm Less than or Equal to a Less than or Equal to 50 mm 500 MPa Less than or Equal .pdf AECMA PREN 3480-2006 Aerospace series Steel FE-PA3601 (X6CrNiTi18-10) Air melted Softened Plate 6 mm Less than or Equal to a Less than or Equal to 50 mm 500 MPa Less than or Equal .pdf
  • AECMA PREN 3481-1988 Aerospace Series Steel FE-PA13 Annealed Reference Heat Treatment Softened Hollow Bars 5 Less Than or Equal to a Less Than or Equal to 12 mm Issue P 1《航空航天系列.钢 .pdf AECMA PREN 3481-1988 Aerospace Series Steel FE-PA13 Annealed Reference Heat Treatment Softened Hollow Bars 5 Less Than or Equal to a Less Than or Equal to 12 mm Issue P 1《航空航天系列.钢 .pdf
  • AECMA PREN 3482-1988 Aerospace Series Steel FE-PA13 Annealed Reference Heat Treatment Softened Forging Stock De Less Than or Equal to 100 mm Issue P 1《航空航天系列.钢 FE-PA13N软化管铸件De小于或等于.pdf AECMA PREN 3482-1988 Aerospace Series Steel FE-PA13 Annealed Reference Heat Treatment Softened Forging Stock De Less Than or Equal to 100 mm Issue P 1《航空航天系列.钢 FE-PA13N软化管铸件De小于或等于.pdf
  • AECMA PREN 3483-1997 Aerospace Series Steel FE-CM3801 (X5CrNiCu16-4) Homogenized Solution Treated Precipitation Hardened and Sub Zero Sand or Investment Casting Rm Greater Than or .pdf AECMA PREN 3483-1997 Aerospace Series Steel FE-CM3801 (X5CrNiCu16-4) Homogenized Solution Treated Precipitation Hardened and Sub Zero Sand or Investment Casting Rm Greater Than or .pdf
  • AECMA PREN 3484-1997 Aerospace Series Steel FE-CM3801 (X5CrNiCu16-4) as Cast Homogenized Solution Treated and Precipitation Hardened Remelting Stock Edition P2《航空航天系列.钢 FE-CM3801(X.pdf AECMA PREN 3484-1997 Aerospace Series Steel FE-CM3801 (X5CrNiCu16-4) as Cast Homogenized Solution Treated and Precipitation Hardened Remelting Stock Edition P2《航空航天系列.钢 FE-CM3801(X.pdf
  • AECMA PREN 3485-1988 Aerospace Series Steel FE-CM61 Homogenised Solution Treated Precipitation Hardened and Sub Zero Rm Greater Than or Equal to 830 MPa Medium Strength Sand or Inv.pdf AECMA PREN 3485-1988 Aerospace Series Steel FE-CM61 Homogenised Solution Treated Precipitation Hardened and Sub Zero Rm Greater Than or Equal to 830 MPa Medium Strength Sand or Inv.pdf
  • AECMA PREN 3486-1988 Aerospace Series Steel FE-PM67 Solution Annealed and Precipitation Hardened 1400 Less Than or Equal to Rm Less Than or Equal to 1550 Mpa Forgings De Less Than .pdf AECMA PREN 3486-1988 Aerospace Series Steel FE-PM67 Solution Annealed and Precipitation Hardened 1400 Less Than or Equal to Rm Less Than or Equal to 1550 Mpa Forgings De Less Than .pdf
  • 相关搜索

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

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