C + + analog mobile phone address book management system

1, Title

Management system of analog mobile phone address book
The main functions are:
(1) View function: select this function to list the categories of mobile phone contacts, such as a colleague, B family member, C friend, D classmate, etc., but when a category is selected, the names and phone numbers in all such data will be listed;
(2) Add function: enter new data (including name, phone number and classification). When duplicate name and phone number are entered, error will be prompted and entry will be cancelled.
(3) Modify function: for the selected contact, modify the related information of its address book. However, if you modify the name, it cannot be the same as the name of other existing contacts.
(4) Delete function: select a contact's name to delete the corresponding data of this person.
(5) Other functions: analyze and design the functions with special effects by yourself as a bonus point. For example: sorting, grouping, personal favorites, recent contacts, etc.
(6) Requirements: design reasonable data structure and realize reasonable and beautiful operation interface.

2, Renderings

  • First page of main interface

  • Main interface page 2

  • The address book I wrote mainly wants to simulate the real situation of the address book as much as possible. First of all, I have set that only three contacts can be displayed on one page. We can turn the page through W and S, just like we can slide up and down the mobile phone to browse the contacts. The contact name is displayed here. We can enter the number in front of the contact name to access it Contact details.

  • Press the corresponding contact number in the main interface to enter the contact details interface (here ★ represents the collected)

  • After pressing the number key, we can enter the contact details interface to see the contact's name, phone number, email address, birthday, whether it is collected or grouped. After entering the contact details interface, we can continue to operate on the current contact, just input the corresponding number key.

  • Press 1 to make a call

  • Call interface press 1 to hang up

  • Press the number key 1 to call the current contact. At the same time, we will write the call record into the nearest contact after the call. I used a random number to simulate the call time here, random number within 5. Press the number key 1 again during the call to return to the previous interface

  • Press 2 to collect or cancel the collection (here ☆ means cancel Collection). The collection can be pressed at any time. As long as you press the current page, you will make a corresponding response, refresh and display the correct characters. At the same time, the subsequent collection list will also make a corresponding record.

  • Press 3 to enter the contact modification interface

  • Modification and duplicate of name

  • Normal modification name

  • The name has been modified. The mobile number has been modified repeatedly

  • Modify cell phone number normally

  • Mobile phone number modification completed, start to modify email

  • Email modification completed and start date of modification

  • Start group modification after birthday modification

  • Modified appearance

  • Delete contact (second confirmation)

  • After the contact is deleted, it disappears in the address book and the number of contacts is reduced (you can delete the current contact and save it immediately after deletion, and update the total number of contacts and the contact structure array at the same time, so that you can't see the deleted contact in the address book display interface. )

  • Name search (fuzzy search)

  • Name search cannot find the entered name

  • Mobile number search (fuzzy search)

  • Mobile number search can't find the entered mobile number

  • Press the corresponding number key when the name is found You can enter the contact details interface for other operations (the same way for mobile number search). The main way to find a contact is to simulate mobile phone search. When the input information is not complete, the contacts that meet the requirements will be output. When the input information is not found at all, nothing will be displayed. After finding a contact, we can enter the contact details interface for other operations Made.

  • Add new contact duplicate name detection

  • Add new contact duplicate mobile number detection

  • Add new contact succeeded

  • The new contact is displayed in the address book and the number of people is displayed plus one

  • Open the favorite contact list and press the corresponding number key to enter the contact details interface for other operations
  • Open group
  • Open family group
  • Open the group of "friends" and press the corresponding number key to enter the contact details interface for other operations
  • Open recent contacts to view people who have recently called
  • Information recorded in address book.txt

3, Analysis

  • The overall idea is to complete the simulation of the entire address book through an array of structures and reading and writing files. The main difficulty lies in the coordination of various functions and the independence of various functions. There are many variables and functions involved. The data structure used is mainly a queue, and the reason why the linked list is not used is between the contacts The relevance is not so strong, as long as we do a good job in sorting and grouping, we use the structure to complete completely enough , we store the information in the file into the structure array, and sort the array in dictionary order at the same time. There is a little shortage here. There is no way to do mixed sorting between Chinese and English. Only after sorting the English names can we sort the Chinese. After sorting the structure array, we can output it. Then we use the written menu interface to add or delete the ordered array The operation of checking and modifying should be saved in time after each operation, and the array should be reordered in time.

4, Code

//XMUT ZRZ 2020.6.19
//jack 123456 12345@qq.com 1 2000 3 1 4
//rise 164459225 1662357@qq.com 1 1999 3 5 2
//rose 134568974 2648235@qq.com 1 2001 1 28 3
//Master unlock Wang 77776 3462156@qq.com  - 1 1995 2 6 1
//Lao Li 2313313 12333@qq.casd  1 1331 4 45 2
//Zheng Runze 1248845 1236356@qq.com -1 2000 3 29 4
#include <iostream>
#include <vector>
#include <ctime>
#include <algorithm>
#include <unordered_map>
#include <fstream>
#include <string>
#include <cstring>
#include <cassert>
#include <windows.h>
#include <conio.h>
#include <time.h>
using namespace std;
#define page_capacity 3
typedef struct Person {
	string name;
	string phonenumber;
	string email;
	int year = 0;
	int month = 0;
	int day = 0;
	int kind = 0;//5 - family 4 - friend 3 - colleague 2 - classmate 1 - others 
	int like = 0;//1 - collected 0 - not collected
}Person;
Person person[100],callperson[100];
int total = 0,call_total=0;
int page = 1;
int index = 0;
void AutoRead()
{
	
	string file = "mail list.txt";
	ifstream infile;
	infile.open(file.data());   //Connect a file stream object to a file 
	assert(infile.is_open());   //If it fails, an error message is output and the program is terminated 
	string s;
	string name, phonenumber, email;
	int year, month, day, kind, like;
	char c;
	infile >> name;
	while ((c = infile.get()) != EOF)
	{
		infile >> phonenumber >> email >> like >> year >> month >> day>>kind ;
		person[total].name = name;
		person[total].phonenumber= phonenumber;
		person[total].email = email;
		person[total].year = year;
		person[total].month = month;
		person[total].day = day;
		person[total].kind = kind;
		person[total++].like = like;
		//cout << "name:" << name<< endl;
		//cout << "phonenumber:" << phonenumber << endl;
		//cout << "email:" << email << endl;
		//cout << "year:" << year << endl;
		//cout << "month:" << month << endl;
		//cout << "day:" << day << endl;
		infile >> name;
	}
	infile.close();             //Close file input stream 
}

void save()
{
	ofstream outfile("mail list.txt", ios::trunc);
	for (int i = 0; i <total; i++)
	{
		outfile << person[i].name << " " << person[i].phonenumber << " "
			<< person[i].email << " " << person[i].like << " "
			<< person[i].year << " " << person[i].month << " "
			<< person[i].day << " " << person[i].kind << " "  << endl;
	}
	outfile.close();
}
int cmp(const Person& s1, const Person& s2) {//Self defined sorting rules 
		return s1.name < s2.name;
}
void Sort()
{
	sort(person, person + total, cmp);
}
bool NameCheck(string name) {
	for (int i = 0; i < total; i++)
	{
		if (person[i].name == name)
			return false;
	}
	return true;
}
bool PhonenumberCheck(string phonenumber) {
	for (int i = 0; i < total; i++)
	{
		if (person[i].phonenumber == phonenumber)
			return false;
	}
	return true;
}
void Call(int index)
{
	system("cls");
	string number = person[index].phonenumber;
	string name = person[index].name;
	callperson[call_total++] = person[index];
	for (int i = 0; i < rand() % 5; i++)
	{
		cout << "            " << name<<" "<<number << "          " << endl;
		cout << "          " << "Calling" << "." << endl;
		Sleep(333);
		system("cls");
		cout << "            " << name << " " << number << "          " << endl;
		cout << "          " << "Calling" << ".." << endl;
		Sleep(333);
		system("cls");
		cout << "            " << name << " " << number << "          " << endl;
		cout << "          " << "Calling" << "..." << endl;
		Sleep(333);
		system("cls");
	}
	int min = 0, sec = 0;
	while (1)
	{
		int x;
		cout << "            " << name << " " << number << "          " << endl;
		cout << "          " << "On call" << "..." << endl;
		cout << "          " << "1.Hang up" << endl;
		cin >> x;
		if (x == 1)
			break;
	}

}
void Add()
{
	int flag = 1;
	while (flag)
	{
		system("cls");
		string newname, newphonenumber, newemail;
		int newyear, newmonth, newday, newkind;
		cout << "Please enter a new name to add:";
		cin >> newname;
		if (NameCheck(newname))
		{
			person[total].name = newname;
			cout << "Enter the new phone number you want to add:";
			cin >> newphonenumber;
			if (PhonenumberCheck(newphonenumber))
			{
				person[total].phonenumber = newphonenumber;
				cout << "Please enter a new mailbox to add:";
				cin >> newemail;
				person[total].email = newemail;
				cout << "Please enter a new birthday to add:";
				cin >> newyear >> newmonth >> newday;
				person[total].year = newyear;
				person[total].month = newmonth;
				person[total].day = newday;
				cout << "Collect?(1-Collection -1-No collection)";
				int y;
				cin >> y;
				if (y == 1)
					person[total].like = 1;
				else if (y == -1)
					person[total].like = -1;
				cout << "Please input the group to be added (5 - family 4 - friends 3 - colleagues 2 - classmate 1 - others):";
				cin >> newkind;
				person[total].kind = newkind;
				cout << newname << " " << newphonenumber << " " << newphonenumber << " "
					<< newemail << " " << newyear << " " << newmonth << " " << newday << " "
					<< newkind << " " << endl;
				int x;
				total = total + 1;
				cout << "Do you want to continue adding? One.Continue 2.return" << endl;
				cin >> x;
				if (x == 1)
					continue;
				else if (x == 2)
					flag--;
			}
			else
			{
				cout << "The mobile number already exists" << endl;
				system("pause");
				flag--;
			}
		}
		else {
			cout << "The name already exists" << endl;
			system("pause");
			flag--;
		}
	}
	save();
}
bool Delete(int index)
{
	cout << "Are you sure you want to delete the current contact?(1.Confirmation 2.cancel)" << endl;
	int x;
	cin >> x;
	if (x == 1)
	{
		
		for (int i = index; i < total - 1; i++)
		{
			person[i] = person[i + 1];
		}
		total--;
		save();
		return true;
	}
	return false;
}
void Change(int index)
{
	int flag = 1;
	while (flag)
	{
		system("cls");
		cout << "full name:";
		cout << person[index].name << endl;
		cout << "Telephone:";
		cout << person[index].phonenumber << endl;
		cout << "Email:";
		cout << person[index].email << endl;
		cout << "birthday:";
		cout << person[index].year << "/" << person[index].month << "/" << person[index].day << endl;
		cout << "Collected or not:";
		if (person[index].like == 1)
		{
			cout << "★" << endl;
		}
		else
		{
			cout << "☆" << endl;
		}
		cout << "grouping:";
		switch (person[index].kind)
		{
		case 1:cout << "other" << endl; break;
		case 2:cout << "classmate" << endl; break;
		case 3:cout << "colleague" << endl; break;
		case 4:cout << "friend" << endl; break;
		case 5:cout << "relatives" << endl; break;
		}
		cout << "1.Change name 2.Modify mobile number 3.Modify mailbox 4.Modify birthday 5.Modify group 6.sign out" << endl;
		int x;
		string newname, newphonenumber, newemail;
		int newyear, newmonth, newday, newkind;
		cin >> x;
		switch (x)
		{
		case 1: {
			
			cout << " Please enter a new name to modify:";
			cin >> newname;
			if(NameCheck(newname))
			person[index].name = newname;
			else
			{
				cout << "The name already exists" << endl;
				system("pause");
			}
			break;
				}
		case 2: {

			cout << " Enter the new phone number you want to modify:";
			cin >> newphonenumber;
			if(PhonenumberCheck(newphonenumber))
			person[index].phonenumber = newphonenumber;
			else
			{
				cout << "The mobile number already exists" << endl;
				system("pause");
			}
			break;
		}
		case 3: {

			cout << " Please enter a new mailbox to modify:";
			cin >> newemail;
			person[index].email = newemail;
			break;
		}
		case 4: {

			cout << " Please enter the new birthday (year month day) to modify:";
			cin >> newyear >> newmonth >> newday;
			person[index].year = newyear;
			person[index].month = newmonth;
			person[index].day = newday;
			
			break;
		}
		case 5: {

			cout << " Please enter the new group to be modified (5-family 4-friend 3-colleague 2-classmate 1-others):";
			cin >> newkind;
			person[index].kind = newkind;
			break;
		}
		case 6: {

			flag--;
			break;
		}
		}
	}
	save();
}
void Query()
{
	while (1)
	{
		int ready[100] = { 0 };
		system("cls");
		cout << "1.Find by Name2.Find 3 by phone number.return" << endl;
		string temp;
		int x, cnt = 0;
		bool find = false;
		cin >> x;
		if (x == 1)
		{
			cout << "Enter the name you want to find:";
			cin >> temp;
			for (int i = 0; i < total; i++)
			{
				string::size_type idx;
				idx = person[i].name.find(temp);//Find b in a
				if (idx == string::npos)//non-existent
					continue;
				else//existence
				{
					ready[cnt++] = i;
					find = true;
					cout << cnt << "." << person[i].name << endl;
				}
			}
			if (find) {
				cout << "Press the number key for details(Press 0 to cancel)";
				int a;
				cin >> a;
				if (a != 0)
				{
					int flag = true;
					while (flag)
					{
						system("cls");
						int x = ready[a - 1];
						cout << "full name:";
						cout << person[x].name << endl;
						cout << "Telephone:";
						cout << person[x].phonenumber << endl;
						cout << "Email:";
						cout << person[x].email << endl;
						cout << "birthday:";
						cout << person[x].year << "/" << person[x].month << "/" << person[x].day << endl;
						cout << "Collected or not:";
						if (person[x].like == 1)
						{
							cout << "★" << endl;
						}
						else
						{
							cout << "☆" << endl;
						}
						cout << "grouping:";
						switch (person[x].kind)
						{
						case 1:cout << "other" << endl; break;
						case 2:cout << "classmate" << endl; break;
						case 3:cout << "colleague" << endl; break;
						case 4:cout << "friend" << endl; break;
						case 5:cout << "relatives" << endl; break;
						}
						cout << "1.Dial 2.Collection 3.Amendment 4.Delete 5.return" << endl;
						int ch;
						cin >> ch;
						switch (ch)
						{
						case 1:Call(ready[a - 1]); break;
						case 2:person[x].like = -person[x].like; save(); break;
						case 3:Change(ready[a - 1]); flag = false; break;
						case 4: {
							if (Delete(ready[a - 1]))
								flag = false;
							break;
						}
						case 5:flag = false; break;
						}
					}
				}
			}
			else
			{
				cout << "No contact found" << endl;
				system("pause");
			}

		}
		else if (x == 2)
		{
			cout << "Enter the phone number you want to find:" << endl;
			cin >> temp;
			for (int i = 0; i < total; i++)
			{
				string::size_type idx;
				idx = person[i].phonenumber.find(temp);//Find b in a
				if (idx == string::npos)//non-existent
					continue;
				else//existence
				{
					ready[cnt++] = i;
					find = true;
					cout << cnt << "." << person[i].name << endl;
				}
			}
			if (find) {
				cout << "Press the number key for details(Press 0 to cancel)";
				int a;
				cin >> a;
				if (a != 0)
				{
					int flag = true;
					while (flag)
					{
						system("cls");
						int x = ready[a - 1];
						cout << "full name:";
						cout << person[x].name << endl;
						cout << "Telephone:";
						cout << person[x].phonenumber << endl;
						cout << "Email:";
						cout << person[x].email << endl;
						cout << "birthday:";
						cout << person[x].year << "/" << person[x].month << "/" << person[x].day << endl;
						cout << "Collected or not:";
						if (person[x].like == 1)
						{
							cout << "★" << endl;
						}
						else
						{
							cout << "☆" << endl;
						}
						cout << "grouping:";
						switch (person[x].kind)
						{
						case 1:cout << "other" << endl; break;
						case 2:cout << "classmate" << endl; break;
						case 3:cout << "colleague" << endl; break;
						case 4:cout << "friend" << endl; break;
						case 5:cout << "relatives" << endl; break;
						}
						cout << "1.Dial 2.Collection 3.Amendment 4.Delete 5.return" << endl;
						int ch;
						cin >> ch;
						switch (ch)
						{
						case 1:Call(ready[a - 1]); break;
						case 2:person[x].like = -person[x].like; save(); break;
						case 3:Change(ready[a - 1]); flag = false; break;
						case 4: {
							if (Delete(ready[a - 1]))
								flag = false;
							break;
						}
						case 5:flag = false; break;
						}
					}
				}
			}
			else
			{
				cout << "No contact found" << endl;
				system("pause");
			}
		}
		else if (x == 3)
		{
			break;
		}
		else 
		continue;
	}

}
void Collect()
{
	int flag = 1;
	while (flag)
	{
		int ready[100] = { 0 };
		system("cls");
		cout << "The favorite list is:" << endl;
		int cnt = 0;
		bool find = false;
			for (int i = 0; i < total; i++)
			{
				if (person[i].like == 1)
				{
					ready[cnt++] = i;
					find = true;
					cout << cnt << "." << person[i].name << endl;
				}
			}
			if (find) {
				cout << "Press the number key for details(Press 0 to exit)";
				int a;
				cin >> a;
				if (a != 0)
				{
					int flag = true;
					while (flag)
					{
						system("cls");
						int x = ready[a - 1];
						cout << "full name:";
						cout << person[x].name << endl;
						cout << "Telephone:";
						cout << person[x].phonenumber << endl;
						cout << "Email:";
						cout << person[x].email << endl;
						cout << "birthday:";
						cout << person[x].year << "/" << person[x].month << "/" << person[x].day << endl;
						cout << "Collected or not:";
						if (person[x].like == 1)
						{
							cout << "★" << endl;
						}
						else
						{
							cout << "☆" << endl;
						}
						cout << "grouping:";
						switch (person[x].kind)
						{
						case 1:cout << "other" << endl; break;
						case 2:cout << "classmate" << endl; break;
						case 3:cout << "colleague" << endl; break;
						case 4:cout << "friend" << endl; break;
						case 5:cout << "relatives" << endl; break;
						}
						cout << "1.Dial 2.Collection 3.Amendment 4.Delete 5.return" << endl;
						int ch;
						cin >> ch;
						switch (ch)
						{
						case 1:Call(ready[a - 1]); break;
						case 2:person[x].like = -person[x].like; save(); break;
						case 3:Change(ready[a - 1]); flag = false; break;
						case 4: {
							if (Delete(ready[a - 1]))
								flag = false;
							break;
						}
						case 5:flag = false; break;
						}
					}
				}
				else {
					flag--;
				}
			}
			else
			{
				cout << "No contact found" << endl;
				system("pause");
				flag--;
			}

		
	}
}
void Group()
{
	int flag = 1;
	int have = 1;
	int pos = 0;
	string which;
	while (flag)
	{
		system("cls");
		cout << "1.Family 2.Friend 3.Colleague 4.Friend 5.other(Press the corresponding number key to view the group) 0.sign out" << endl;
		int x;
		cin >> x;
		switch (x)
		{
			case 1:
			{
				pos = 5;
				which = "family";
				break;
			}
			case 2:
			{
				pos = 4;
				which = "friend";
				break;
			}
			case 3:
			{
				pos = 3;
				which = "colleague";
				break;
			}
			case 4:
			{
				pos = 2;
				which = "classmate";
				break;
			}
			case 5:
			{
				pos = 1;
				which = "other";
				break;
			}
			case 0:
			{
				flag--;
				have--;
				break;
			}

		}
		if (have)
		{
			int ready[100] = { 0 };
			system("cls");
			cout << which << "The list is:" << endl;
			int cnt = 0;
			bool find = false;
			for (int i = 0; i < total; i++)
			{
				if (person[i].kind == pos)
				{
					ready[cnt++] = i;
					find = true;
					cout << cnt << "." << person[i].name << endl;
				}
			}
			if (find) {
				cout << "Press the number key for details(Press 0 to exit)";
				int a;
				cin >> a;
				if (a != 0)
				{
					int flag = true;
					while (flag)
					{
						system("cls");
						int x = ready[a - 1];
						cout << "full name:";
						cout << person[x].name << endl;
						cout << "Telephone:";
						cout << person[x].phonenumber << endl;
						cout << "Email:";
						cout << person[x].email << endl;
						cout << "birthday:";
						cout << person[x].year << "/" << person[x].month << "/" << person[x].day << endl;
						cout << "Collected or not:";
						if (person[x].like == 1)
						{
							cout << "★" << endl;
						}
						else
						{
							cout << "☆" << endl;
						}
						cout << "grouping:";
						switch (person[x].kind)
						{
						case 1:cout << "other" << endl; break;
						case 2:cout << "classmate" << endl; break;
						case 3:cout << "colleague" << endl; break;
						case 4:cout << "friend" << endl; break;
						case 5:cout << "relatives" << endl; break;
						}
						cout << "1.Dial 2.Collection 3.Amendment 4.Delete 5.return" << endl;
						int ch;
						cin >> ch;
						switch (ch)
						{
						case 1:Call(ready[a - 1]); break;
						case 2:person[x].like = -person[x].like; save(); break;
						case 3:Change(ready[a - 1]); flag = false; break;
						case 4: {
							if (Delete(ready[a - 1]))
								flag = false;
							break;
						}
						case 5:flag = false; break;
						}
					}
				}
				else {
					flag--;
				}
			}
			else
			{
				cout << "No contact found" << endl;
				system("pause");
			}
		}
	}

}
void Recently()
{
	int flag = 1;
	while (flag)
	{
		system("cls");
		int j = 1;
		int ready[100] = { 0 };
		system("cls");
		int cnt = 0;
		bool find = false;
		cout << "Recent contact list:";
		for (int i = call_total - 1; i >= 0; i--)
		{
			ready[cnt++] = i;
			find = true;
			cout << j++ << "." << callperson[i].name << " " << callperson[i].phonenumber << endl;
		}
		if (find) {
			cout << "Press the number key to call back(Press 0 to exit)";
			int a;
			cin >> a;
			if (a != 0)
			{
				Call(ready[a - 1]);
			}
			else {
				flag--;
			}
		}
		else
		{
			cout << "No contact found" << endl;
			system("pause");
			flag--;
		}

	}
}
void PersonPrint()
{
	int a[100] = {0};
	Sort();
	if (total == 0)
		cout << "No contacts in address book" << endl;
	for (int i = index; i < index+page_capacity; i++)
	{
		if (i == total)
			break;
		cout << i + 1 << ". ";
		a[i]++;
		cout << person[i].name << endl;
	}
	cout << "The first" << (index / page_capacity)+1 << "page" << endl;
	char c;
	cin >> c;
	if (c >= '0' && c <= '9')
	{
		if (a[c - 49])
		{
			bool flag = true;
			while (flag)
			{
				system("cls");
				int x = c - 49;
				cout << "full name:";
				cout << person[x].name << endl;
				cout << "Telephone:";
				cout << person[x].phonenumber << endl;
				cout << "Email:";
				cout << person[x].email << endl;
				cout << "birthday:";
				cout << person[x].year << "/" << person[x].month << "/" << person[x].day << endl;
				cout << "Collected or not:";
				if (person[x].like==1)
				{
					cout << "★" << endl;
				}
				else
				{
					cout << "☆" << endl;
				}
				cout << "grouping:";
				switch (person[x].kind)
				{
				case 1:cout << "other" << endl; break;
				case 2:cout << "classmate" << endl; break;
				case 3:cout << "colleague" << endl; break;
				case 4:cout << "friend" << endl; break;
				case 5:cout << "relatives" << endl; break;
				}
				cout << "1.Dial 2.Collection 3.Amendment 4.Delete 5.return" << endl;
				int ch;
				cin >> ch;
				switch (ch)
				{
					case 1:Call(c - 49); break;
					case 2:person[x].like = -person[x].like; save(); break;
					case 3:Change(c - 49); flag = false; break;
					case 4: {
						if (Delete(c - 49))
						flag = false; 
						break;
					}
					case 5:flag = false; break;
				}
			}
		}
	}
	else 
	{
		switch (c)
		{
		case ('s'):
			{
				index += page_capacity;
				if(index>=total)
					index -= page_capacity;
				break;
			}
		case ('w'):
			{
				index -= page_capacity;
				if (index < 0)
					index = 0;
				break;
			}
		case ('a'):
			{		
				Add();
				break;
			}
		case ('q'):
		{
			Query();
			break;
		}
		case ('e'):
		{
			Collect();
			break;
		}
		case ('f'):
		{
			Group();
			break;
		}
		case ('r'):
		{
			Recently();
			break;
		}
		case ('d'):
		{
			save();
			exit(0);
			break;
		}
		}
		
	}
	
}
void headmenu()
{
	system("cls");
	cout << "                            Welcome to mobile phone directory" << endl;
	cout << "                           Currently, there are:" << total << "people" << endl;
	cout << "          q.lookup  a.add to  e.Collection  f.grouping  r.recent contacts   d.Save and exit" << endl;
	cout << "                            Press the number key to open the corresponding contact" << endl;
	cout << "                            Press the letter to do the corresponding operation" << endl;
	cout << "                             Press the direction key w and s Turn the page" << endl;
	PersonPrint();
}

int main()
{
	AutoRead();
	while(1)
	headmenu();
}

Tags: Mobile Windows iOS

Posted on Fri, 19 Jun 2020 01:46:41 -0400 by Fergusfer