⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 清华大学计算机系数据结构课程教材《数据结构 用面向对象方法和C++描述》(殷人昆主编)的类库(书中程序的源代码)
💻 CPP
字号:

#include "AString.h"
int main(){
	cout<<"取子串" <<endl;
	AString str("Tsinghua");
	AString substr=str(1,3);
	cout<<substr<<endl;
	cout<<"取第i个字符"<<endl;
	cout<<str[5]<<str[6]<<endl;
	cout<<endl;
	cout<<"串连接"<<endl;
	AString temp(" University");
	str+=temp;
	cout<<str<<endl;
	cout<<endl;
	cout<<"找子串"<<endl;
	AString s("hu");
	cout<<str.Find(s,0)<<endl;;
	cout<<endl;
	cout<<"KMP匹配"<<endl;
	int next[24]={0};
	str.getNext(next);
	cout<<str.fastFind(s,0,next)<<endl;
	cout<<endl;
	cout<<"测试完毕"<<endl;

	while(1)//为了在类库说明文档中便于观察,加入这一句
		cout<<"";
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -