[计算机类试卷]计算机三级数据库技术(上机操作)机试模拟试卷64及答案与解析.doc

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

1、计算机三级数据库技术(上机操作)机试模拟试卷 64及答案与解析 一、程序设计题 1 编写函数 findStr(char*str, char*substr),该函数统计一个长度为 2的子字符串substr在另一个字符串 str中出现的次数,该次数作为函数值返回。例如,假定输入的字符串为 ”asd asasdfg asdas zx67 asd mklo”。子字符串为 ”as”,函数返回值是6。函数 ReadWrite()实现从数据文件 in dat中读取两个字符串,并调用函数findStr(),最后把结果输出到文件 out dat中。 【试题程序】 #include #include void R

2、eadWrite(); int findStr(char*str char*substr) main() char str81, substr3; int n; printf(“输入原字符串: ”); gets(str); printf(“输入子字符串: ”); gets(substr); puts(str); puts(substr); n=findStr(str, substr); printf(“n= d n”, n); ReadWrite(); void ReadWrite() char str81, substr3, oh! int n, len, i=0; FILE*rf,*wf!

3、 rf=fopen(“in dat”。 “r”); wf=fopen(“out dat”, “W”); while(i5) fgets(str, 80, rf); fgets(substr, 10, rf); len=strlen(substr)一 1; ch=substr1en, if(oh= n ch=0xla) substr1en=0; n=findStr(str, substr); fprintf(wf。 “ d n”n); i+; fclose(rf); felose(wf); 计算机三级数据库技术(上机操作)机试模拟试卷 64答案与解析 一、程序设计题 1 【正确答案】 int findStr(char*str char*substr) int i, cnt=0; *定义变量 * for(i=0; i80;i+) *统计次数 * if(*(str+i)=*substr return cnt;

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 2591-B9-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part B9 - Current Temperature Derating (Edition 1)《航空航天系列 电气和光学连接部件 试验方法 第B9部.pdf ASD-STAN PREN 2591-B9-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part B9 - Current Temperature Derating (Edition 1)《航空航天系列 电气和光学连接部件 试验方法 第B9部.pdf
  • ASD-STAN PREN 2591-C1-1991 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C1 - Endurance at Temperature (Edition 1)《航空航天系列 电气和光学连接部件 试验方法 第C1部分 温度.pdf ASD-STAN PREN 2591-C1-1991 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C1 - Endurance at Temperature (Edition 1)《航空航天系列 电气和光学连接部件 试验方法 第C1部分 温度.pdf
  • ASD-STAN PREN 2591-C10-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C10 - Cold (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C10部分 低温 第P1版》.pdf ASD-STAN PREN 2591-C10-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C10 - Cold (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C10部分 低温 第P1版》.pdf
  • ASD-STAN PREN 2591-C11-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C11 - Low Air Pressure (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C11部分 低气压 第P1.pdf ASD-STAN PREN 2591-C11-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C11 - Low Air Pressure (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C11部分 低气压 第P1.pdf
  • ASD-STAN PREN 2591-C12-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C12 - Air Leakage (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C12部分 漏气 第P1版》.pdf ASD-STAN PREN 2591-C12-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C12 - Air Leakage (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C12部分 漏气 第P1版》.pdf
  • ASD-STAN PREN 2591-C13-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C13 - Driving Rain (Artificial) (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C13部.pdf ASD-STAN PREN 2591-C13-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C13 - Driving Rain (Artificial) (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C13部.pdf
  • ASD-STAN PREN 2591-C14-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C14 - Immersion at Low Air Pressure (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第.pdf ASD-STAN PREN 2591-C14-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C14 - Immersion at Low Air Pressure (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第.pdf
  • ASD-STAN PREN 2591-C15-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C15 - Fluid Resistance (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C15部分 耐流体性 第P.pdf ASD-STAN PREN 2591-C15-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C15 - Fluid Resistance (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C15部分 耐流体性 第P.pdf
  • ASD-STAN PREN 2591-C16-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C16 - Ozone Resistance (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C16部分 抗臭氧性 第P.pdf ASD-STAN PREN 2591-C16-1992 Aerospace Series Elements of Electrical and Optical Connection Test Methods Part C16 - Ozone Resistance (Issue P 1)《航空航天系列 电气和光学连接部件 试验方法 第C16部分 抗臭氧性 第P.pdf
  • 相关搜索

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

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