【计算机类职业资格】计算机三级(数据库技术)上机考试2及答案解析.doc

上传人:tireattitude366 文档编号:1337302 上传时间:2019-10-17 格式:DOC 页数:2 大小:28KB
下载 相关 举报
【计算机类职业资格】计算机三级(数据库技术)上机考试2及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】计算机三级(数据库技术)上机考试2及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机三级(数据库技术)上机考试 2 及答案解析(总分:-1.00,做题时间:90 分钟)1.函数 ReadDat()的功能是实现从文件 ENG4.IN 中读取一篇英文文章,存入到字符串数组 xx 中。请编制函数 encryptChar(),按给定的替代关系对数组 xx 中的所有字符进行替代,结果仍存入数组 xx 对应的位置上,最后调用函数 WriteDat()把结果 xx 输出到文件 PS4.DAT 中。 替代关系:f(p)=p*11 mod 256(p是数组 xx 中某一个字符的 ASCII 值,f(p)是计算后新字符的 ASCII 值),如果计算后 f(p)的值小于等于32 或大于 13

2、0,则该字符不变,否则将 f(p)所对应的字符进行替代。 注意:部分源程序已给出。 原始数据文件存放的格式是:每行的宽度均小于 80 个字符。 请勿改动主函数 main()、读函数 ReadDat()和写函数 WriteDat()的内容。 试题程序: #include #include #include #include unsigned char xx5080; int maxline = 0;/* 文章的总行数 */ int ReadDat(void); void WriteDat(void); void encryptChar() main() clrscr(); if(ReadDat(

3、) printf(“数据文件 ENG4.IN 不能打开!n007“); return; encryptChar(); WriteDat(); int ReadDat(void) FILE *fp; int i = 0; unsigned char *p; if(fp = fopen(“ENG4.IN“, “r“) =NULL) return 1; while(fgets(xxi, 80, fp) !=NULL) p = strchr(xxi, n ); if(p) *p = 0; i+; maxline = i; fclose(fp); return 0; void WriteDat(void) FILE *fp; int i; fp = fopen(“PS4.DAT“, “w“); for(i = 0; i 130 | *pf*11%256=32)”语句来实现,如果该字符不满足上述条件,就用一个新的字符来替代,新的字符是当前的字符乘以 11 的结果再去与 256 求余数。处理完毕后,指针去取下一个字符。如果该字符满足所给条件,将不做任何操作,指针直接下移,去取下一个字符,对下一个字符进行处理。

展开阅读全文
相关资源
猜你喜欢
  • DIN 1185-2-2015 Drainage - Control of sub-surface water management by draining with pipes and amelioration of the subsoil - Part 2 Planning and dimensioning《排水 管道排水和底层土壤改良的地下水管理控制 .pdf DIN 1185-2-2015 Drainage - Control of sub-surface water management by draining with pipes and amelioration of the subsoil - Part 2 Planning and dimensioning《排水 管道排水和底层土壤改良的地下水管理控制 .pdf
  • DIN 1185-3-2015 Drainage - Control of sub-surface water management by draining with pipes and amelioration of the subsoil - Part 3 Construction and documentation《排水 管道排水和底层土壤改良的地下水.pdf DIN 1185-3-2015 Drainage - Control of sub-surface water management by draining with pipes and amelioration of the subsoil - Part 3 Construction and documentation《排水 管道排水和底层土壤改良的地下水.pdf
  • DIN 11851-2013 Stainless steel fittings for the food and chemical industry Screw pipe connections for expanding and welding《食品和化学行业的不锈钢管件 胀接和焊接的螺纹管接头》.pdf DIN 11851-2013 Stainless steel fittings for the food and chemical industry Screw pipe connections for expanding and welding《食品和化学行业的不锈钢管件 胀接和焊接的螺纹管接头》.pdf
  • DIN 11852-2009 Fittings for the food and chemical industries - Fittings of stainless steel - Tees bends and reducers for welding《食品业、化工业用装置 不锈钢装置 焊接用三通管、弯头和异径接头》.pdf DIN 11852-2009 Fittings for the food and chemical industries - Fittings of stainless steel - Tees bends and reducers for welding《食品业、化工业用装置 不锈钢装置 焊接用三通管、弯头和异径接头》.pdf
  • DIN 11853-1-2011 Stainless steel fittings for the food and chemical industry - Part 1 Hygienic screwed pipe connection short type《食品和化学工业用不锈钢配件 第1部分 短型卫生螺纹管接头》.pdf DIN 11853-1-2011 Stainless steel fittings for the food and chemical industry - Part 1 Hygienic screwed pipe connection short type《食品和化学工业用不锈钢配件 第1部分 短型卫生螺纹管接头》.pdf
  • DIN 11853-2-2011 Stainless steel fittings for the food and chemical industry - Part 2 Hygienic flanged pipe connection short type《食品和化学工业用不锈钢配件 第2部分 无菌法兰管连接件 短类型》.pdf DIN 11853-2-2011 Stainless steel fittings for the food and chemical industry - Part 2 Hygienic flanged pipe connection short type《食品和化学工业用不锈钢配件 第2部分 无菌法兰管连接件 短类型》.pdf
  • DIN 11853-3-2011 Stainless steel fittings for the food and chemical industry - Part 3 Hygienic clamp pipe connection short type《无菌 食品和化学工业用不锈钢管件 第3部分 管连接用卫生短管夹》.pdf DIN 11853-3-2011 Stainless steel fittings for the food and chemical industry - Part 3 Hygienic clamp pipe connection short type《无菌 食品和化学工业用不锈钢管件 第3部分 管连接用卫生短管夹》.pdf
  • DIN 11854-2015 Components for the food and pharmaceutical industry - Hose unions of stainless steel《食品和医药工业的组成部分 不锈钢软管接头》.pdf DIN 11854-2015 Components for the food and pharmaceutical industry - Hose unions of stainless steel《食品和医药工业的组成部分 不锈钢软管接头》.pdf
  • DIN 11861-1976 Drink- and dairy fittings sealing rings made of elastomeric materials requirements testing《饮料和乳品用管件 橡胶密封圈 要求和试验》.pdf DIN 11861-1976 Drink- and dairy fittings sealing rings made of elastomeric materials requirements testing《饮料和乳品用管件 橡胶密封圈 要求和试验》.pdf
  • 相关搜索
    资源标签

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

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