📄 main.cpp
字号:
#include "HashTable.h"
#include <iostream>
using namespace std;
int main()
{
Hash dog;
Data dt,result;
int choose = 1;
while(choose)
{
cout<<"\n插入单词,按1";
cout<<"\n删除单词,按2";
cout<<"\n查找单词,按3";
cout<<"\n退出,按0"<<endl;
cin>>choose;
switch(choose)
{
case 1:
cout<<"输入要插入的单词:";
cin>>dt.word ;
cout<<"输入相应的解释(不允许中间有空格存在):";
cin>>dt.means ;
dog.Insert(dt);
break;
case 2:
cout<<"\n输入要删除的单词:";
cin>>dt.word ;
dog.Remove(dt.word );
break;
case 3:
cout<<"\n输入要查找的单词:";
cin>>dt.word ;
if( dog.Find(dt.word ,result))
cout<<"\n该单词解释为: "<<result.means<<endl;
else cout<<"\n没有该单词"<<endl;
break;
case 0:
cout<<"\n拜拜"<<endl;
return 1;
default:
cout<<"\n选择有误,重新选择:";
break;
};
}
return 1;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -