通讯录管理系统
#include<iostream>
using namespace std;
#define max 1000
void showmenu()
{
cout << "***** 1.添加联系人 *****" << endl;
cout << "***** 2.显示联系人 *****" << endl;
cout << "***** 3.删除联系人 *****" << endl;
cout << "***** 4.查找联系人 *****" << endl;
cout << "***** 5.修改联系人 *****" << endl;
cout << "***** 6.清空联系人 *****" << endl;
cout << "***** 0.退出通讯录 *****" << endl;
}
struct people
{
string name;
int sex;
int age;
int phone;
string add;
};
struct book
{
struct people parray[max];
int size;
};
void addpeople(book* abs)
{
if (abs->size == max)
{
cout << "通讯录已满" << endl;
return;
}
else
{
string name;
cout << "请输入姓名" << endl;
cin >> name;
abs->parray[abs->size].name = name;
int sex;
cout << "请输入性别" << endl;
cout << "1.男\t" << "2.女\t" << endl;
while (true)
{
cin >> sex;
if (sex == 1 || sex == 2)
{
abs->parray[abs->size].sex = sex;
break;
}
cout << "输入有误重新输入" << endl;
}
int