电话本的功能在menu菜单里完全体现了:
cout << "这是一个电话本程序,可以执行以下操作:" << endl;
- #include"iostream"
- #include"cstdlib"
- #include"string"
- #include"fstream"
- #include"utility"
- #include"vector"
- #include"windows.h"
- using namespace std;
-
- class number
- {
- private:
-
string name; -
string num; - public:
-
void search(string); -
void add(); -
void del(string); -
void show(string); -
void copy(); -
friend ostream &operator <<(ostream &output,const number &p) -
{ -
output << p.name << endl; -
output << p.num << endl; -
return output; -
} -
-
void input() -
{ -
请输入姓名:" << endl;cout << " -
cin >> name; -
请输入电话:" << endl;cout << " -
cin >> num; -
} -
number(string name1=" ",string num1=" ") -
{ -
this->name = name1; -
this->num = num1; -
} -
~number() -
{} - };<

这是一个使用C++编写的电话本管理程序,包括搜索、添加、删除、查看、文件操作等功能。用户可以通过菜单交互式地进行电话簿的操作,如搜索特定联系人、添加新联系人、删除联系人、显示所有联系人等。程序通过读写文本文件来存储和加载电话本数据。

2701

被折叠的 条评论
为什么被折叠?



