当前位置: 首页 > news >正文

企业可以做哪些网站有哪些内容吗建站赔补

企业可以做哪些网站有哪些内容吗,建站赔补,电商运营培训课程,深圳市科技网站开发学习贺利坚老师顺序串算法库 数据结构之自建算法库——顺序串_创建顺序串s1,创建顺序串s2-CSDN博客 本人详细解析博客 串的概念及操作_串的基本操作-CSDN博客 版本更新日志 V1.0: 在贺利坚老师算法库指导下, 结合本人详细解析博客思路基础上,进行测试, 加入异常弹出信息 v1.0补…学习贺利坚老师顺序串算法库 数据结构之自建算法库——顺序串_创建顺序串s1,创建顺序串s2-CSDN博客 本人详细解析博客 串的概念及操作_串的基本操作-CSDN博客 版本更新日志 V1.0: 在贺利坚老师算法库指导下, 结合本人详细解析博客思路基础上,进行测试, 加入异常弹出信息 v1.0补丁: 完善Error ,合法性检测内部,加入英语提示,并有对应函数标号 V1.0 函数功能: //(1)将一个字符串数组赋值给顺序串 void Assignment_Sequential_string(Sequential_string New_String, char Assign_array[]); //(2) 复制一个串,到另一个串 void Copy_Sequential_String(Sequential_string accept_string, Sequential_string copy_string); //(3)判断两个串是否相等 bool Equal_Sequential_String(Sequential_string judge_string1, Sequential_string judge_string2); //(4)求顺序串串长 int Length_Sequential_String(Sequential_string measure_string); //(5)串连接 Sequential_string Connect_Sequential_String(Sequential_string link1, Sequential_string link2); //(6)求子串(从begin_loation开始的number个字符) Sequential_string Get_Sequential_Substring(Sequential_string substring, int begin_loation, int number); //(7)插入串(从从begin_loation开始插入字符串,然后组合成新的串) Sequential_string Insert_Sequential_String(Sequential_string old_string, int begin_loation,Sequential_string insert_string); //(8)删除串(从begin 开始的number个字符) Sequential_string Delete_Sequential_String(Sequential_string old_string, int begin_loation,int number); //(9)串替换(从begin 开始的number个字符) Sequential_string Replace_Sequential_String(Sequential_string old_string, int begin_loation,int number,Sequential_string new_string); //(10)输出展示串 void Display_Sequential_String(Sequential_string show_String); 顺序串头函数 Sequential_string.h #ifndef _SEQUENTIAL_STRING_H_INCLUDE #define _SEQUENTIAL_STRING_H_INCLUDE#include stdio.h #define MaxSize 100 //最多字符个数//顺序串数据结构 typedef struct {char Sequential_string_data[MaxSize];//数组串数据int length; //实际串长 }Sequential_string;//(1)将一个字符串数组赋值给顺序串 void Assignment_Sequential_string(Sequential_string New_String, char Assign_array[]); //(2) 复制一个串,到另一个串 void Copy_Sequential_String(Sequential_string accept_string, Sequential_string copy_string); //(3)判断两个串是否相等 bool Equal_Sequential_String(Sequential_string judge_string1, Sequential_string judge_string2); //(4)求顺序串串长 int Length_Sequential_String(Sequential_string measure_string); //(5)串连接 Sequential_string Connect_Sequential_String(Sequential_string link1, Sequential_string link2); //(6)求子串(从begin_loation开始的number个字符) Sequential_string Get_Sequential_Substring(Sequential_string substring, int begin_loation, int number); //(7)插入串(从从begin_loation开始插入字符串,然后组合成新的串) Sequential_string Insert_Sequential_String(Sequential_string old_string, int begin_loation,Sequential_string insert_string); //(8)删除串(从begin 开始的number个字符) Sequential_string Delete_Sequential_String(Sequential_string old_string, int begin_loation,int number); //(9)串替换(从begin 开始的number个字符) Sequential_string Replace_Sequential_String(Sequential_string old_string, int begin_loation,int number,Sequential_string new_string); //(10)输出展示串 void Display_Sequential_String(Sequential_string show_String); #endif顺序串库函数 Sequential_string.cpp #include Sequential_string.h/************************************************** (1)函数名: Assignment_Sequential_string 功 能: 将一个字符串数组赋值给顺序串 参 数: (1)Sequential_string New_String:创建的新串(2)char Assign_array[]: 原始字符串数组 注 意: 顺序数组,结尾加入\0 返回值: 无 **************************************************/ void Assignment_Sequential_string(Sequential_string New_String, char Assign_array[]) {int counter;for(counter 0; Assign_array[counter] ! \0; counter){New_String.Sequential_string_data[counter] Assign_array[counter];}New_String.Sequential_string_data[counter] \0;New_String.length counter; //更新串最大位序 }/************************************************** (2)函数名: Copy_Sequential_String 功 能: 复制一个串,到另一个串 参 数: (1)Sequential_string accept_string: 复制成的串(2)Sequential_string copy_string:要复制的串 注 意: 复制成的串,传回的是地址,所以不用传回参数 返回值: 无 **************************************************/ void Copy_Sequential_String(Sequential_string accept_string, Sequential_string copy_string) {int counter;for(counter 0; counter copy_string.length;counter){accept_string.Sequential_string_data[counter] copy_string.Sequential_string_data[counter];}accept_string.Sequential_string_data[counter] \0;accept_string.length copy_string.length; } /************************************************** (3)函数名: Equal_Sequential_String 功 能: 判断两个串是否相等 参 数: (1)Sequential_string judge_string1:第一个串(2)Sequential_string judge_string2:第二个串 返回值: bool?是否相等,true:false **************************************************/ bool Equal_Sequential_String(Sequential_string judge_string1, Sequential_string judge_string2) {bool same true;int counter;if(judge_string1.length ! judge_string2.length){same false;}else{for(counter 0; counter judge_string1.length;counter){if(judge_string1.Sequential_string_data[counter] ! judge_string2.Sequential_string_data[counter]){same false;break;}}}return same;}/************************************************** (4)函数名: Length_Sequential_String 功 能: 求顺序串串长 参 数: Sequential_string measure_string:要进行测量的串 返回值: int:顺序串长度信息 **************************************************/ int Length_Sequential_String(Sequential_string measure_string) {return measure_string.length; }/************************************************** (5)函数名: Connect_Sequential_String 功 能: 把两个串连接成一个串 参 数: Sequential_string link1, Sequential_string link2:两个要链接的串 返回值: 返回Sequential_string Connection_string: 链接成的串 **************************************************/ Sequential_string Connect_Sequential_String(Sequential_string link1, Sequential_string link2) {Sequential_string Connection_string;int counter;Connection_string.length link1.length link2.length;//将第一个串加入链接的串for(counter 0; counter link1.length; counter){Connection_string.Sequential_string_data[counter] link1.Sequential_string_data[counter];}//将第二个串加入链接的串for(counter 0; counter link2.length; counter){Connection_string.Sequential_string_data[link1.lengthcounter] link2.Sequential_string_data[counter];}Connection_string.Sequential_string_data[link1.lengthcounter] \0;return Connection_string; }/************************************************** (6)函数名: Get_Sequential_Substring 功 能: 求子串(从begin_loation开始的number个字符) 参 数: (1)Sequential_string mother_String:母串(2)int begin_loation:开始分割子串的位置(3)int number:子串的数量 返回值: Sequential_string son_String:得到的子串 **************************************************/ Sequential_string Get_Sequential_Substring(Sequential_string mother_String, int begin_loation, int number) {Sequential_string son_String;int counter;son_String.length 0;if(begin_loation 0 || begin_loation mother_String.length || number 0 || begin_loationnumber-1mother_String.length){//错误:分割的子字符串的位置错误。printf(\nError6:The position of the divided substring is wrong.\n);return son_String; // 参数不正确返回空串}for(counter begin_loation-1; counter begin_loationnumber-1; counter){son_String.Sequential_string_data[counter-begin_loation1] mother_String.Sequential_string_data[counter];}son_String.Sequential_string_data[counter-begin_loation1] \0;son_String.length number;return son_String; }/************************************************** (7)函数名: Insert_Sequential_String 功 能: 插入串(从从begin_loation开始插入字符串,然后组合成新的串) 参 数: (1)Sequential_string old_string:在原始串的基础上插入(2)int begin_loation: 插入的位置(3)Sequential_string insert_string:插入的新串 思 路: 在原有串的基础上,割开一个口子,放上新串,然后组合成新串 返回值: Sequential_string form_string:组合成的新串 **************************************************/ Sequential_string Insert_Sequential_String(Sequential_string old_string, int begin_loation,Sequential_string insert_string) {int counter;Sequential_string form_string;form_string.length 0;//参数不正确, 返回空串if(begin_loation 0 || begin_loation old_string.length1){//错误:插入位置错误printf(\nError7: wrong insertion position.\n);return form_string;}for(counter 0; counter begin_loation-1;counter){form_string.Sequential_string_data[counter] old_string.Sequential_string_data[counter];}for(counter 0; counter insert_string.length;counter){form_string.Sequential_string_data[begin_loation-1counter] insert_string.Sequential_string_data[counter];}for(counter begin_loation-1; counterold_string.length;counter){form_string.Sequential_string_data[insert_string.lengthcounter] old_string.Sequential_string_data[counter];}form_string.Sequential_string_data[insert_string.lengthcounter] \0;form_string.length old_string.length insert_string.length;return form_string;} /************************************************** (8)函数名: Delete_Sequential_String 功 能: 删除串(从begin 开始的number个字符) 参 数: (1)Sequential_string old_string:在原有串的基础上删除(2)int begin_loation: 开始删除的位置(从逻辑1开始)(3)int number:删除的数量 注 意: 要判断删除的位置和数量是否正确 返回值:Sequential_string new_string:删除完后的新串 **************************************************/ Sequential_string Delete_Sequential_String(Sequential_string old_string, int begin_loation,int number) {int counter;//定义计数器Sequential_string new_string;new_string.length 0;//合法性判断(begin_loation理应从1开始到leng长度)if(begin_loation 0 || begin_loation old_string.length || (begin_loationnumber-1) old_string.length){//错误:删除的位置或数量错误。printf(Error8: Wrong location or quantity of deletion.);return new_string;//返回空串}//择出删除位置之前的串for(counter 0; counter begin_loation-1;counter){new_string.Sequential_string_data[counter] old_string.Sequential_string_data[counter];}//择出删除位置之后的串for(counter begin_loationnumber-1; counter old_string.length; counter){new_string.Sequential_string_data[counter-number] old_string.Sequential_string_data[counter];}new_string.Sequential_string_data[counter-number] \0;new_string.length old_string.length - number;return new_string; }/************************************************** (9)函数名: Replace_Sequential_String 功 能: 串替换(从begin 开始的number个字符) 参 数: (1)Sequential_string old_string:原始串(2)int begin_loation:开始替换的位置(3)int number:替换的字符个数(4)Sequential_string replace_string:要替换成的字符串 思 路: 锁定old_string从begin_loation开始的number个字符,然后开始剪切建立新串,①把begin_loation之前的字符加入新串,②要替换成的串加入,③锁定后的字符加入④组合成新串,返回传出 注 意: 最后加\0 返回值: Sequential_string new_string:替换后,产生的新串 **************************************************/ Sequential_string Replace_Sequential_String(Sequential_string old_string, int begin_loation,int number,Sequential_string replace_string) {int counter;Sequential_string new_string;new_string.length 0;//合法性判断if(begin_loation 0 || begin_loation old_string.length || begin_loationnumber-1old_string.length){//错误:要替换位置出现错误printf(\nError9: There is an error in the position to be replaced.\n);return new_string;//返回空串}//开始复制剪切for(counter 0; counter begin_loation-1; counter){new_string.Sequential_string_data[counter] old_string.Sequential_string_data[counter];}//加入要替换的串for(counter 0; counter replace_string.length; counter){new_string.Sequential_string_data[begin_loation-1counter] replace_string.Sequential_string_data[counter];}//被替换位置,后面剩余的串for(counter begin_loationnumber-1; counter old_string.length; counter){new_string.Sequential_string_data[counter-numberreplace_string.length] old_string.Sequential_string_data[counter];}new_string.Sequential_string_data[counter-numberreplace_string.length] \0;new_string.length old_string.length - number replace_string.length;return new_string; }/************************************************** (10)函数名: Display_Sequential_String 功 能: 输出展示串 参 数: Sequential_string show_String:要输出展示的串 注 意: 字符串后续可以换成自定义类型 返回值: 无 **************************************************/ void Display_Sequential_String(Sequential_string show_String) {int counter;if(show_String.length 0){for(counter 0; counter show_String.length; counter){printf(%c, show_String.Sequential_string_data[counter]);}printf(\n);} }main函数测试 1: 范围正常情况下测试: 主函数文件名字 main.cpp #include stdio.h #include Sequential_string.hint main() {Sequential_string test_string,test_string1,test_string2,test_string3,test_string4;char test_char1[ ] {a,b,c,d,e,f,g,h,i,j,k,l,m,n,\0};char test_char2[] {1,2,3,\0};printf(\n顺序串的基本运算如下:\n);printf(\n(1)建立串test_string和test_string1\n);Assignment_Sequential_string(test_string, test_char1);printf(\n(2)输出串test_string:\n);Display_Sequential_String(test_string);Assignment_Sequential_string(test_string1, test_char2);printf(\n(2)输出串test_string1:\n);Display_Sequential_String(test_string1);printf(\n(3)串test_string的长度是:%d\n,Length_Sequential_String(test_string));printf(\n(4)在串test_string的第9个字符位置插入串test_string1,从而产生test_string2\n);test_string2 Insert_Sequential_String(test_string,9,test_string1);printf(\n(5)输出串test_string2:\n);Display_Sequential_String(test_string2);printf(\n(6)删除串test_string2第2个字符开始的五个字符,而产生串2\n);test_string2 Delete_Sequential_String(test_string2,2,5);printf(\n(7)输出串test_string2:\n);Display_Sequential_String(test_string2);printf(\n(8)将串2第二个字符开始的5个字符替换成串1,从而产生串2\n);test_string2 Replace_Sequential_String(test_string2,2,5,test_string1);printf(\n(9)输出串2\n);Display_Sequential_String(test_string2);printf(\n(10)提取串2的第二个字符开始的5个字符而产生串3\n);test_string3 Get_Sequential_Substring(test_string2,2,5);printf(\n(11)输出串3\n);Display_Sequential_String(test_string3);printf(\n(12)将串2和串3链接起来,而产生串4\n);test_string4 Connect_Sequential_String(test_string2,test_string3);printf(\n(13)输出串4\n);Display_Sequential_String(test_string4);return 0; }运行结果展示: main函数测试 2: 范围超出情况下测试: 主函数文件名字 main.cpp #include stdio.h #include Sequential_string.hint main() {Sequential_string test_string,test_string1,test_string2,test_string3,test_string4;char test_char1[ ] {a,b,c,d,e,f,g,h,i,j,k,l,m,n,\0};char test_char2[] {1,2,3,\0};printf(\n顺序串的基本运算如下:\n);printf(\n(1)建立串test_string和test_string1\n);Assignment_Sequential_string(test_string, test_char1);printf(\n(2)输出串test_string:\n);Display_Sequential_String(test_string);Assignment_Sequential_string(test_string1, test_char2);printf(\n(2)输出串test_string1:\n);Display_Sequential_String(test_string1);printf(\n(3)串test_string的长度是:%d\n,Length_Sequential_String(test_string));printf(\n(4)在串test_string的第100个字符位置插入串test_string1,从而产生test_string2\n);test_string2 Insert_Sequential_String(test_string,100,test_string1);printf(\n(5)输出串test_string2:\n);Display_Sequential_String(test_string2);printf(\n(6)删除串test_string2第99个字符开始的五个字符,而产生串2\n);test_string2 Delete_Sequential_String(test_string2,99,5);printf(\n(7)输出串test_string2:\n);Display_Sequential_String(test_string2);printf(\n(8)将串2第88个字符开始的5个字符替换成串1,从而产生串2\n);test_string2 Replace_Sequential_String(test_string2,88,5,test_string1);printf(\n(9)输出串2\n);Display_Sequential_String(test_string2);printf(\n(10)提取串2的第33个字符开始的5个字符而产生串3\n);test_string3 Get_Sequential_Substring(test_string2,33,5);printf(\n(11)输出串3\n);Display_Sequential_String(test_string3);printf(\n(12)将串2和串3链接起来,而产生串4\n);test_string4 Connect_Sequential_String(test_string2,test_string3);printf(\n(13)输出串4\n);Display_Sequential_String(test_string4);return 0; }运行结果展示:
http://www.dnsts.com.cn/news/8322.html

相关文章:

  • 我的网站设计联盟网站开发三个流程
  • 用ps做衣服网站首页外国人做的网站
  • 制作一个买股票的网站怎么做python基础教程第三版
  • 知名网站规划ps做网站宽度
  • 用心做的网站深圳vi设计哪家好
  • 大连可以做网站的公司做网站有了域名
  • 镇江网站优化哪家好国外工业设计作品集
  • 网站在百度上做推广怎样做免费h5制作app平台
  • 云南省城乡建设培训中心网站技术支持 上海做网站
  • 孝感网站开发优搏好wordpress右侧
  • 餐厅网站设计哪里做网站排名
  • 东莞建站模板源码宿迁网站建设价格低
  • 视频网站做app还是h5中国500强公司排名查询
  • photoshop+做网站logo会计专业建设规划
  • 备案个人网站做淘宝客wordpress改变文章字体大小
  • 北京网站设计公司jq成都柚米科技15淄博瓷砖网站建设中企动力
  • 网站想要游览怎么做宁波网站推广服务
  • 怎样做网站的seo深圳专业网站开发公司
  • 网站访问量统计怎么做站长推广工具
  • 做设计外包的网站如何拥有自己的域名
  • 辽宁城乡建设部网站广州建设集团股份有限公司
  • 大连网站建设平台vi设计公司排名前十强
  • 套系网站怎么做dw个人网页制作模板源代码
  • 代码命名 网站网络营销简介
  • 什么网站可以做任务挣钱的百度推广登录
  • 想搞网站建设网站策划论坛
  • 那些视频网站能用来直接做hrefwordpress 主题 制作视频教程
  • 狐表做网站动漫网站源码下载
  • 深圳中心网站建设网站header设计
  • 遵义哪里有做网站的淄博网站建设 很乱