(2)显示所有人信息
(3)快速查找联系人
(4)删除联系人
3、程序清单 #include
#include
struct Person {
char name[15]; char telephone[15]; char sex[15]; char age[15]; char addrass[15]; struct Person *next; };
typedef struct Person per; per *head=NULL;
void LinkList()//添加信息 {
per *a=NULL,*b=NULL;
a=(per *)malloc(sizeof(per));
printf(\输入姓名=======:\\n\ scanf(\
printf(\输入电话=======:\\n\ scanf(\
printf(\输入性别=======:\\n\ scanf(\
printf(\输入年龄========:\\n\ scanf(\
printf(\输入地址========:\\n\ scanf(\
a->next=NULL; //
if(head==NULL) {
head=(per *)malloc(sizeof(per)); head->next=a; } else {
for(b=head;b->next!=NULL;b=b->next); b->next=a; }
printf(\此信息已添加!\\n\}
void show()//显示所有人的信息 { per *a;
if(head==NULL) {
printf(\此通讯录中无记录,请输入记录后在使用本功能!\\n\ //return; }
printf(\姓名* 电话* 性别* 年龄* 地址*\\n\ for(a=head->next;a!=NULL;a=a->next) {printf(\ \ printf(\ \ printf(\ \ printf(\ \ printf(\ \ } }