⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 -

📁 大二时候做的C++课程设计。题目是“通讯录”
💻
字号:
#include "list.h"
void heart();
void main()
{
	system("title 通讯录(作者:刘芳、徐文朝) 目前时间:%time:~0,2%:%time:~3,2%");
	system("color fc");
	cout<<endl;
	cout<<endl;
	cout<<"                           ╔══════════╗"<<endl;
	cout<<"                           ║      通讯录简介    ║"<<endl;
	cout<<"                           ╚══════════╝"<<endl;
	cout<<"                           ║作者: 刘芳  徐文朝  ║"<<endl; 
	cout<<"                           ║                    ║"<<endl;
	cout<<"                           ║班级: 信管 062001   ║"<<endl;
	cout<<"                           ║                    ║"<<endl;
	cout<<"                           ║功能: 简单通讯录功能║"<<endl;
	cout<<"                           ║                    ║"<<endl;
	cout<<"                           ║  按任意键进入......║"<<endl;
	cout<<"                           ╚══════════╝"<<endl;
	system("pause>nul");

	//登录区
	for(int k=0;1;k++)
	{
		system("cls");
		if(k == 3) 
		{
			cout<<"尝试超过3次...再见..."<<endl;
			return;
		}
		char code[10];
		//ystem("cls");
		cout<<"输入使用密码:";
		cin>>code;

		if(strcmp(code,"123") == 0) break;
		else	
		{
			cout<<"使用码错误!任意键重新输入..."<<endl;
			system("pause>nul");
		}

	}
	
	//	登录区
	for(int i=0;i<8;i++)
	{
		if(i%2==0)
		{
			system("color cf");
			continue;
		}
		system("color fc");
	}
/*	char welcom[7][20];
	strcpy(welcom[0],"欢");
	strcpy(welcom[1],"欢迎");
	strcpy(welcom[2],"欢迎进");
	strcpy(welcom[3],"欢迎进入");
	strcpy(welcom[4],"欢迎进入.");
	strcpy(welcom[5],"欢迎进入..");
	strcpy(welcom[6],"欢迎进入..");
	for(int j=0;j<7;j++)
	{
		system("cls");
		cout<<welcom[j];
		system("ping -n 1 127.1>nul");
	}
*/
	heart();
}

void heart()
{
	char get;	
	CAddrList myList;

	if(!myList.IsemptyOfFile())//初始化通讯录的状态,是否为空
	{
		myList.createchain();	 //建立链表,方便以后的操作
		system("cls");
		cout<<"链表建立成功..."<<endl;
		Sleep(1000);
	}
	else
	{
		system("cls");
		cout<<"未建立链表..."<<endl;
		Sleep(1000);
	}

	while(1)
	{
		system("cls");
		cout<<"                           ╔══════════╗"<<endl;
		cout<<"                           ║    通讯录主菜单    ║"<<endl;
		cout<<"                           ╚══════════╝"<<endl;
		cout<<"                           ║a.录入        e.修改║"<<endl; 
		cout<<"                           ║                    ║"<<endl;
		cout<<"                           ║b.查找        f.浏览║"<<endl;
		cout<<"                           ║                    ║"<<endl;
		cout<<"                           ║c.详情        g.保存║"<<endl;
		cout<<"                           ║                    ║"<<endl;
		cout<<"                           ║d.删除        h.退出║"<<endl;
		cout<<"                           ╚══════════╝"<<endl;
		cin>>get;
		switch(get)
		{
		case 'a':
		case 'A':
			myList.addmem();
			myList.save();
			break;
		case 'b':
		case 'B':
			myList.query();
			break;
		case 'c':
		case 'C':
			myList.detail();
			//cout<<"任意键继续..."<<endl;
			//system("pause>nul");
			break;
		case 'd':
		case 'D':
			myList.remove();
			break;
		case 'e':
		case 'E':
			if(myList.GetStateOfChain())
				myList.rework();
			else
			{
				cout<<"通讯录为空!任意键返回..."<<endl;
				system("pause>nul");
			}
			break;
		case 'f':
		case 'F':
			if(myList.GetEmptyOfList())
			{
				cout<<"通讯录为空!任意键继续..."<<endl;
				system("pause>nul");
			}
			else
			{
				myList.display();
				cout<<"                                                   任意键回到主菜单....."<<endl;
				system("pause>nul");
			}
			break;
		case 'g':
		case 'G':
			myList.save();
			cout<<"保存成功!任意键返回..."<<endl;
			system("pause>nul");
			break;
		case 'h':
			cout<<"你确定要退出?(Y/N)...";
			cin>>get;
			if(get=='Y'|| get=='y') 
			{
				myList.save();
				return;
			}
			break;
		}//switch
	}//wihle
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -