問題及**:
sqstring.cpp/*
*煙台大學計算機與控制工程學院
/* *檔名稱:sqstring.cpp
*完成日期:2023年10月23日
*版本號:v1.o
* *問題描述:定義順序串的儲存結構,實現其基本運算,並完成測試
*/
main.cpp#include #include #include "sqstring.h"
void strassign(sqstring &s,char cstr)
void strcopy(sqstring &s,sqstring t)
sqstring;
void strassign(sqstring &s,char cstr);
void strcopy(sqstring &s,sqstring t);
bool strequal(sqstring s,sqstring t);
int strlength(sqstring s);
sqstring concat(sqstring s,sqstring t);
sqstring substr(sqstring s,int i,int j);
sqstring insstr(sqstring s1,int i,sqstring s2);
sqstring delstr(sqstring s,int i,int j) ;
sqstring repstr(sqstring s,int i,int j,sqstring t);
void dispstr(sqstring s);
#endif
執行結果:#include #include "sqstring.h"
int main()
知識點及總結:
原檔案中包含著含有各種演算法的函式的定義,標頭檔案中包含定義資料結構和要實現演算法的函式的宣告,main函式負責相關的除錯的工作。
第八周專案1建立演算法庫順序串
問題及描述 輸入描述 sqstring.h ifndef sqstring h included define sqstring h included define maxsize 100 最多的字元個數 typedef struct sqstring void strassign sqstring...
第八周專案1 建立順序串演算法庫
檔名稱 shunxuchuan.cpp 完成日期 2015年10月30日 版本號 vc 6.0 問題描述 建立順序串演算法庫 輸入描述 無 程式輸出 子串,串連線,串刪除,串插入等 ifndef head h included define head h included include inclu...
第八周專案1 建立順序串演算法庫
問題及 檔名稱 專案1.cbp 作 者 董雪 完成日期 2016年10月20日 版 本 號 v1.0 問題描述 定義順序串的儲存結構,實現其基本運算,並完成測試。輸入描述 無 程式輸出 測試資料 1.標頭檔案sqstring.h ifndef sqstring h included define s...