#include#include#include #include using namespace std;#define MAX 1000 struct Person{ string m_Name; int m_Sex; int m_Age; string m_Phone; string m_Addr;};struct Addressbooks{ struct Person personArray[MAX]; int m_Size;};void addPerson(Addressbooks*abs){ if(abs->m_Size==MAX) { cout<<"通讯录已满,无法添加!"<>name; abs->personArray[abs->m_Size].m_Name=name; cout<<"请输入性别:"<男"<女"<>sex; if(sex==1||sex==2) { abs->personArray[abs->m_Size].m_Sex=sex; break; } cout<<"输入有误,请重新输入"<>age; abs->personArray[abs->m_Size].m_Age=age; cout<<"请输入电话号码:"<>phone; abs->personArray[abs->m_Size].m_Phone=phone; cout<<"请输入家庭住址"<>address; abs->personArray[abs->m_Size].m_Addr=address; abs->m_Size++; cout<<"添加成功"<m_Size==0) { cout<<"当前记录为空"<m_Size;i++) { cout<<"姓名:"<personArray[i].m_Name<<" "; cout<<"性别:"<<(abs->personArray[i].m_Sex==1?"男":"女")<<" "; cout<<"年龄:"<personArray[i].m_Age<<" "; cout<<"电话:"<personArray[i].m_Phone<<" "; cout<<"住址:"<personArray[i].m_Addr<m_Size;i++) { if(abs->personArray[i].m_Name==name) { return i; } } return -1;}void deletePerson(Addressbooks*abs){ cout<<"请输入您要删除的联系人"<>name; int ret=isExist(abs,name); if(ret!=-1) { for(int i=ret;im_Size;i++) { abs->personArray[i]=abs->personArray[i+1]; } abs->m_Size--; cout<<"删除成功"<>name; int ret=isExist(abs,name); if(ret!=1) { cout<<"姓名:"<personArray[ret].m_Name<<" "; cout<<"性别:"<<(abs->personArray[ret].m_Sex==1?"男":"女")<<" "; cout<<"年龄:"<personArray[ret].m_Age<<" "; cout<<"电话:"<personArray[ret].m_Phone<<" "; cout<<"住址:"<personArray[ret].m_Addr<>name; int ret=isExist(abs,name); if(ret!=-1) { cout<<"请输入名字:"<>name; abs->personArray[abs->m_Size].m_Name=name; cout<<"请输入性别:"<男"<女"<>sex; if(sex==1||sex==2) { abs->personArray[abs->m_Size].m_Sex=sex; break; } cout<<"输入有误,请重新输入"<>age; abs->personArray[abs->m_Size].m_Age=age; cout<<"请输入电话号码:"<>phone; abs->personArray[abs->m_Size].m_Phone=phone; cout<<"请输入家庭住址"<>address; abs->personArray[abs->m_Size].m_Addr=address; abs->m_Size++; cout<<"修改成功"<m_Size=0; cout<<"通讯录已清空"<>select; switch(select) { case 1: addPerson(&abs); break; case 2: showPerson(&abs); break; case 3: deletePerson(&abs); system("pause"); system("cls"); break; case 4: findPerson(&abs); break; case 5: modifyPerson(&abs); break; case 6: cleanPerson(&abs); break; case 0: { cout<<"欢迎您下一次使用"<