C编程之通讯录设计

#include <stdio.h>
#include <stdlib.h>


#define OK            0
#define ERROR        -1
#define MALLOC_ERROR -2 


int temp_ID = 1;


typedef struct node
{
int ID;    // 结点的数据
char name[21];
char person_phone[21];
char office_phone[21];
char address[21];
struct node *next;   // 结点指针
}t;


typedef struct node *PNode;     // 重命名结点指针类型


void zhujiemian(void)
{
printf("\t##########################################################\n");
printf("\t##                      通讯录                          ##\n");
printf("\t##       INSERT ---------------------添加好友信息       ##\n");
printf("\t##       DISPLAY---------------------列表好友信息       ##\n");
printf("\t##       SEARCH ---------------------搜索好友           ##\n");
printf("\t##       DELETE ---------------------删除好友           ##\n");
printf("\t##                                                      ##\n");
printf("\t##                                         作者:陈志辉 ##\n");
printf("\t##########################################################\n");
}


void cho1(int *p1, int *p2, int *p3, int *p4) //判断输入口令
{
    char a[40];
char bijiao[4][11]={"INSERT","DISPLAY","SEARCH","DELETE"};
int i;
int j = 0;
int temp=1;//检测标志位
    printf("\t请输入操作命令:");


while(temp)
{
i = 0;
scanf("%s", a);//输入口令 字符长度检测


for(i=0; i<4; i++)//校验命令
{
if(a[0] == bijiao[i][0])
{
for(j=1; j<10; j++)
{
if(a[j] != bijiao[i][j])//校验1
{
// i++;
break;
}
else if(a[j] == '\0' && i == 0)
{
*p1 = 1;
break;
}

if(a[j] != bijiao[i][j])//校验2
{
// i++;
break;
}
else if(a[j] == '\0' && i == 1)
{
*p2 = 1;
break;
}

if(a[j] != bijiao[i][j])//校验3
{
break;
}
else if(a[j] == '\0' && i == 2)
{
*p3 = 1;
break;
}

if(a[j] != bijiao[i][j])//校验4
{
break;
}
else if(a[j] == '\0' && i == 3)
{
*p4 = 1;
break;
}
}
if(*p1 || *p2 || *p3 ||*p4)
{  
temp=0;
break;
}
}
if (temp == 0)
{
break;
}
}
if(temp)
{
printf("\t口令错误,请重新输入!\n\n\t请输入操作命令:");
}
}




}


//INSERT————添加通讯录好友 尾插法
int creat_list_tail(PNode h)
{
if (h == NULL)
{
return ERROR;
}
PNode node = (PNode)malloc(sizeof(t)/sizeof(char));
if (node == NULL)
{
return MALLOC_ERROR;
}
printf("\t          \n");
printf("\t新建联系人: \n");
char name[21];
char person_phone[21];
    char office_phone[21];
char address[21];

printf("\t\t请输入姓名:    ");
scanf("%s",name);
printf("\t\t请输入手机号码:");
scanf("%s",person_phone);
printf("\t\t请输入家庭住址:");
scanf("%s",address);
printf("\t\t请输入公司电话:");
scanf("%s",office_phone);

node->next = NULL;
node->ID = temp_ID++;
int i;
for(i = 0; i < 21; i++)
{
node->name[i] = name[i];
}
for(i = 0; i < 21; i++)
{
node->person_phone[i] = person_phone[i];
}
for(i = 0; i < 21; i++)
{
node->address[i] = address[i];
}
for(i = 0; i < 21; i++)
{
node->office_phone[i] = office_phone[i];
}

PNode temp = h;
while (temp->next)
{
temp = temp->next;
}
temp->next = node;

return OK;
}


void display(PNode h)
{
if (h == NULL)
{
return;
}
PNode temp = h->next;  // 链表第一个结点指针
while (temp)
{
printf("\tID:");
printf("\t\t%08d\n",temp->ID);
printf("\t姓名");
printf("\t\t%s\n",temp->name);
printf("\t手机号码:");
printf("\t%s\n",temp->person_phone);
printf("\t家庭住址:");
printf("\t%s\n",temp->address);
printf("\t公司电话:");
printf("\t%s\n",temp->office_phone);
temp = temp->next;
}
}


int search(PNode h, char *p)
{
if (h == NULL)
{
return ERROR;
}
PNode temp = h->next;
// printf("%c",*p);

int i;
int flag = 1;
while(temp)
{
for(i = 0; i < 21; i++)
{
if(*(p+i) != temp->name[i])
{
break;
}
else if( (*(p+i) == '\0') && (temp->name[i] == '\0') )
{
flag = 0;
printf("\tID:");
printf("\t%08d\n",temp->ID);
printf("\t姓名");
printf("\t%s\n",temp->name);
printf("\t手机号码:");
printf("\t%s\n",temp->person_phone);
printf("\t家庭住址:");
printf("\t%s\n",temp->address);
printf("\t公司电话:");
printf("\t%s\n",temp->office_phone);
printf("\n");
break;
}
}
temp = temp->next;
}
if (flag)
{
printf("\t没有此联系人!\n");
}

return OK;



int del(PNode h, char *p)
{
//1搜索联系人

if (h == NULL)
{
return ERROR;
}
PNode temp = h->next;

int i;
int name_count = 0;
int a[20];
while(temp)
{
for(i = 0; i < 21; i++)
{
if(*(p+i) != temp->name[i])
{
break;
}
else if( (*(p+i) == '\0') && (temp->name[i] == '\0') )
{
a[name_count] = temp->ID;
name_count++;
break;
}
}
temp = temp->next;
}

//2删除联系人
PNode front = NULL;

if (name_count == 0)
{
printf("\t没有此联系人!\n");
}
else
{
printf("\t查找到联系人%d个\n",name_count);
printf("\t选择联系人删除:\n");
i = 0;
while(i < name_count )
{
printf("\t\tID%d: %08d\n",i+1,a[i]);
i++;
}
int choose;
printf("\t输入要删除好友ID:");
scanf("%d",&choose);
temp = h->next;

if(temp->next == NULL)
{
free(temp);
h->next = NULL;
}
else
{   
while(temp)
{
if(temp->ID == choose)
{
PNode m = front->next;
front->next = m->next;
free(m);
m=NULL;


front=temp;
temp = temp->next;
}
}
}

return OK;



int main()
{
//链表初始化,建立空链表
PNode head_node = (PNode)malloc(sizeof(t)/sizeof(char));
if (head_node == NULL)
{
return ERROR;
}
head_node->next = NULL;   // 空链表

//功能标志位
int INSERT=0;
int *p1 = &INSERT;
int DISPLAY=0;
    int *p2 = &DISPLAY;
int SEARCH=0;
int *p3 = &SEARCH;
int DELETE=0;
int *p4 = &DELETE;

//开始装逼
printf("\t通讯录载入中...\n");
sleep(1);
system("clear");

while(1)
{
//显示主界面
zhujiemian();

//功能选择
while(!(INSERT || DISPLAY || SEARCH || DELETE))
{
  //判断输入口令
cho1(p1, p2, p3, p4);
}
sleep(1);

//功能选择INSERT————添加通讯录好友
while(INSERT)
{
system("clear");
       printf("\tINSERT模式 ---------------------添加好友信息\n");
if(creat_list_tail(head_node) != OK)
{
printf("\t添加好友失败!\n");
return ERROR;
}
else
{
printf("\n\t添加好友成功!\n");
}
printf("\t返回主菜单...\n\n");
sleep(1);
INSERT = 0;
// back_zhujiemian(p1);
}


while(DISPLAY)//显示通讯录好友
{
system("clear");
printf("\t进入DISPLAY模式---------------------列表好友信息\n\n");
display(head_node);
printf("\n\t返回主菜单...\n\n");
sleep(1);
DISPLAY = 0;
}


while(SEARCH)//搜索通讯录好友
{
system("clear");
printf("\t进入SEARCH模式 ---------------------搜索好友\n\n");
printf("\t请输入联系人姓名:");
char name[21];
scanf("%s",name);
if(search(head_node,name) != OK)
{
return ERROR;
// printf("#1");
}
printf("\n\t返回主菜单...\n\n");
sleep(1);
SEARCH = 0;
}


while(DELETE)//删除通讯录好友
{
system("clear");
printf("\t进入DELETE模式 ---------------------删除好友\n\n");
printf("\t请输入联系人姓名:");
char name[21];
scanf("%s",name);
if(del(head_node,name) != OK)
{
return ERROR;
}  
printf("\n\t返回主菜单...\n\n");
sleep(1);
DELETE = 0;
}
}
return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C语言编写的通讯录管理程序设计 #include"stdio.h" #include"stdlib.h" #include"string.h" #include"conio.h" #define HEADER1"------------------------------------------MESSAGE MENU--------------------------------------------------------------\n" #define HEADER2" | num | name | phonenumber | address |\n" #define HEADER3" |-------------------------------------------------------------------|\n" #define FORMAT " | %-10s %-10s %-15s %-20s |\n" #define DATA p->num,p->name,p->phonenum,p->address #define END " ------------------------------------------------------------------------------------------------------------------\n" #define N 100 int saveflag=0; /*是否需要存盘的标志变量*/ typedef struct record /*标记为record*/ { char num[4]; /*编号*/ char name[10]; /*姓名*/ char phonenum[15]; /*电话*/ char address[20]; /*地址*/ } RECORD; RECORD tele[N]; void menu(); void Disp(); void Qur(); void Modify(); void SelectSort(); void Wrong(); void Save(); void main() { RECORD tele[N]; /*定义RECOED结构体*/ FILE *fp; /*文件指针*/ int select; /*保持内选择结果变量*/ char ch; /*保存y,Y,n,N*/ int count=0; /*保存文件中的记录条数(或元素个数)*/ fp=fopen("C:\\record.txt","a+"); /*以追加方式打开文本文件c;\record,可读可写,若此文件不存在,会创建此文件*/ if(fp==NULL) { printf("\n=>Can not open file!\n"); exit(0); } while(!feof(fp)) { if(fread(&tele[count],sizeof(RECORD),1,fp)==1) /*一次从文件中读取一条通讯记录*/ count++; } fclose(fp); /*关闭文件*/ printf("\n=>Open file success,the total records number is:%d.\n",count); getchar(); menu(); while(1) { system("cls"); menu(); cprintf("\n Please input your choice(0-8):"); /*显示提示信息*/ ch=getch(); if(ch=='0') { if(saveflag==1) /*若对数组的数据有修且未进行存盘操作,则此标志为1*/ { getchar(); printf("\n==>Whether save the modified record to file?(y/n):"); scanf("%c",&ch); if(ch=='y'||ch=='Y') Save(tele,count); } printf("\n=>Thank you for useness!"); getchar(); break ; } switch(ch) { case'0':break; case'1':count=Add(tele,count);break; /*增加通讯记录*/ case'2':system("cls");Disp(tele,count);break; /*显示通讯记录*/ case'3':count=Del(tele,count) ;break; /*删除通讯记录*/ case'4':Qur(tele,count);break; /*查询通讯记录*/ case'5':Modify(tele,count);break; /*修改通讯记录*/ case'6':count=Insert(tele,count);break; /*插入通讯记录*/ case'7':SelectSort(tele,count);break;/*排序通讯记录*/ case'8':Save(tele,count);break; /*保存通讯记录*/ default: Wrong();getchar();break; /*按键有误,必需为0~8*/ } } } void menu() { system("cls"); /*调用DOS命令清屏,与clrscr()功能相同*/ textcolor(63); /*在文本模式中选择新的字符颜色*/ gotoxy(10,5); /*在文本窗口中设置光标*/ printf(" The communication management system\n"); gotoxy(10,8); printf(" ****Menu**** \n"); gotoxy(10,9); printf("\n"); gotoxy(10,10); printf("\* 1. Add record\n"); /*增加*/ gotoxy(10,11); printf("\* 2. Display record\n"); /*展览*/ gotoxy(10,12); printf("\* 3. Delete record\n"); /*删除*/ gotoxy(10,13); printf("\* 4. Search record\n"); /*查找*/ gotoxy(10,14); printf("\* 5. Modify record\n"); /*更改*/ gotoxy(10,15); printf("\* 6. Insert record\n"); /*插入*/ gotoxy(10,16); printf("\* 7. Sort record\n"); /*整理*/ gotoxy(10,17); printf("\* 8. Save record\n"); /*保存*/ gotoxy(10,18); printf("\* 0 Quit system\n"); /*退出*/ gotoxy(10,19); printf(" ************ \n"); /*cprintf()送格式话输出至文本窗口屏幕中*/ } /*格式化输出表头*/ void printheader() { printf(HEADER1); printf(HEADER2); printf(HEADER3); } /*格式化输出表中数据*/ void printdata(RECORD q) { RECORD *p; p=&q; printf(FORMAT,DATA); } void Disp( RECORD temp[],int n) /*显示数组temp[]中存储的通讯记录,内容为record结构中定义的内容*/ { int i; if(n==0) /*表示没有通讯记录*/ { printf("\n=>No menu record!\n"); getchar(); return ; } printf("\n\n"); printheader(); /*输出表格头部*/ i=0; while(i<n) /*逐条输出数组中存储的通讯记录*/ { printdata(temp[i]); i++; printf(HEADER3); } getchar(); } void Wrong() /*输出按键错误信息*/ { printf("\n\n\n\n\n**********Error:input has wrong! press any key to continue***********\n"); getchar(); } void Nofind() /*输出未查找到此记录的信息*/ { printf("\n=>Not find this menu record!\n"); } int Locate(RECORD temp[],int n,char findmess[],char nameorphonenum[]) { int i=0; if(strcmp(nameorphonenum,"phonenum")==0) /*按电话号码查询*/ { while(i<n) { if(strcmp(temp[i].phonenum,findmess)==0) /*若找到findmess值的电话号码*/ return i; i++; } } else if(strcmp(nameorphonenum,"name")==0) /*按姓名查询*/ { while(i<n) { if(strcmp(temp[i].name,findmess)==0) /*若找到findmess值的姓名*/ return i; i++; } } return -1; /*若未找到,返回一个整数-1*/ } void stringinput(char *t,int lens,char *notice) { char n[255]; do { printf(notice); /*显示提示信息*/ scanf("%s",n); /*输入字符串*/ if(strlen(n)>lens) printf("\n Exceed the required length! \n"); /*进行长度检测,超过lens值重新输入*/ } while(strlen(n)>lens); strcpy(t,n); /*将输入发字符串拷贝到字符串t中*/ } int Add(RECORD temp[],int n) /*增加通讯记录*/ { char ch,num[10]; int i,flag=0; system("cls"); Disp(temp,n); /*先打印出已有的通讯录信息*/ while(1) /*一次可输入多条记录,直至输入编号为0的记录才结束添加操作*/ { while(1) /*输入记录编号,保证该编号没有被使用,若输入编号为0,则退出添加记录操作*/ { stringinput(num,10,"Input number(press '0' return menu):"); /*格式化输入编号并检验*/ flag=0; if(strcmp(num,"0")==0) /*输入为0,则退出添加操作,返回主界面*/ { return n; } i=0; while(i<n) /*产寻该编号是否已经存在,若存在则要求重新输入一个未被占用的编号*/ { if(strcmp(temp[i].num,num)==0) { flag=1; break; } i++; } if(flag==1) /*提示拥护是否重新输入*/ { getchar(); printf("==>The number %s is existing,try again?(y/n):",num); scanf("%c",&ch); if(ch=='y'||ch=='Y') continue; else return n; } else {break;} } strcpy(temp[n].num,num); /*将字符串num拷贝到temp[n].num中*/ stringinput(temp[n].name,15,"Name:\n"); stringinput(temp[n].phonenum,15,"Telephone:\n"); stringinput(temp[n].address,15,"Address:\n"); saveflag=1; n++; } return n; } void Qur(RECORD temp[],int n) /*按编号或姓名查询通讯记录*/ { int select; /*按1:按姓名查,2:按电话号码查,其他:返回住界面(菜单)*/ char searchinput[20]; /*包寻用户输入的查询内容*/ int p=0; if(n<=0) /*若数组为空*/ { system("cls"); printf("\n=>No menu record!\n"); getchar(); return ; } system("cls"); printf("\n =>1 Search by name =>2 Search by telephonenumber\n"); printf(" Please choice[1,2]:"); scanf("%d",&select); if(select==1) /*按姓名查询*/ { stringinput(searchinput,10,"Input the existing name:"); p=Locate(temp,n,searchinput,"name"); /*在数组temp中查找编号为searchinput值的元素,并返回该数组元素的下标值*/ if(p!=-1) /*若找到该记录*/ { printheader(); printdata(temp[p]); printf(END); printf("Press any key to return"); getchar(); } else Nofind(); getchar(); } else if(select==2) /*按电话号码查询*/ { stringinput(searchinput,15,"Input the existing telephone number:"); p=Locate(temp,n,searchinput,"phonenum"); if(p!=-1) { printheader(); printdata(temp[p]); printf(END); printf("Press any key to return"); getchar(); } else Nofind(); getchar(); } else Wrong(); getchar(); } int Del(RECORD temp[],int n) { int sel; char findmess[20]; int p=0,i=0; if(n<=0) { system("cls"); printf("\n=>No menu record!\n"); getchar(); return n; } system("cls"); Disp(temp,n); printf("\n =>1 Delete by name =>2 Delete by telephonenumber\n"); printf(" Please choice[1,2]:"); scanf("%d",&sel); if(sel==1) { stringinput(findmess,10,"Input the existing name:"); p=Locate(temp,n,findmess,"name"); getchar(); if(p!=-1) { for(i=p+1;i<n;i++) /*删除此记录,后面记录向前移*/ { strcpy(temp[i-1].num,temp[i].num); strcpy(temp[i-1].name,temp[i].name); strcpy(temp[i-1].phonenum,temp[i].phonenum); strcpy(temp[i-1].address,temp[i].address); } printf("\n=>Delete success!\n"); n--; getchar(); saveflag=1; } else Nofind(); getchar(); } else if(sel==2) /*先按电话号码查询到该记录所在的数组元素的下标值*/ { stringinput(findmess,15,"Input the existing telephone number:"); p=Locate(temp,n,findmess,"phonenum"); getchar(); if(p!=-1) { for(i=p+1;i<n;i++) /*删除此记录,后面的记录向前移*/ { strcpy(temp[i-1].num,temp[i].num); strcpy(temp[i-1].name,temp[i].name); strcpy(temp[i-1].phonenum,temp[i].phonenum); strcpy(temp[i-1].address,temp[i].address); } printf("\n=>Delete success!\n"); n--; getchar(); saveflag=1; } else Nofind(); getchar(); } return n; } void Modify(RECORD temp[],int n) { char findmess[20]; int p=0; if(n<=0) { system("cls"); printf("\n=>No menu record!\n"); getchar(); return ; } system("cls"); printf("modify menu book recorder"); Disp(temp,n); stringinput(findmess,10,"Input the existing name:"); /*输入并检验该姓名*/ p=Locate(temp,n,findmess,"name"); /*查询到该数组元素,并返回下标值*/ if(p!=-1) /*若p!=-1,表明已经找到该数组元素*/ { printf("Number:%s,\n",temp[p].num); printf("Name:%s,",temp[p].name); stringinput(temp[p].name,15,"Input new name:"); printf("Name:%s,",temp[p].phonenum); stringinput(temp[p].name,15,"Input new telephone:"); printf("Name:%s,",temp[p].address); stringinput(temp[p].address,30,"Input new address:"); printf("\n=>modify success!\n");getchar(); Disp(temp,n); getchar();saveflag=1; } else { Nofind(); getchar(); } return ; } int Insert(RECORD temp[],int n) { char ch,num[10],s[10]; /*s[]保存插入点位置之前的记录编号,num[]保存输入的新记录的编号*/ RECORD newinfo; int flag=0,i=0,m=0; system("cls"); Disp(temp,n); while(1) { stringinput(s,10,"Please input insert location after the Number:"); flag=0;i=0; while(i<n) /*查询该编号是否存在,flag=1表示该编号存在*/ { if(strcmp(temp[i].num,s)==0) { m=i; flag=1; break; } i++; } if(flag==1) break; /*若编号存在,则进行插之前的新记录输入操作*/ else { getchar(); printf("\n=>The number is not existing,try again?(y\n):",s); scanf("%c",&ch); if(ch=='y'||ch=='Y') { continue; } else { return n; } } } /*以下新记录的输入操作与Add()相同*/ while(1) { stringinput(num,10,"Input new Number:"); flag=0;i=0; while(i<n) /*查询该编号是否存在,flag=1表示该编号存在*/ { if(strcmp(temp[i].num,num)==0) { flag=1; break; } i++; } if(flag==1) { getchar(); printf("\n=>Sorry,The number %s is existing,try again?(y\n):",num); scanf("%c",&ch); if(ch=='y'||ch=='Y') { continue; } else { return n; } } else break; } strcpy(newinfo.num,num); /*将字符串num拷贝到newinfo.num中*/ stringinput(newinfo.name,15,"Name:"); stringinput(newinfo.phonenum,15,"Telephone:"); stringinput(newinfo.address,15,"Address:"); saveflag=1; /*在main()中有对该全局变量的判断,若为1,则进行存盘操作*/ for(i=n-1;i>m;i--) /*从最后一个组织元素开始往前移一个元素位置*/ { strcpy(temp[i+1].num,temp[i].num); strcpy(temp[i+1].name,temp[i].name); strcpy(temp[i+1].phonenum,temp[i].phonenum); strcpy(temp[i+1].address,temp[i].address); } strcpy(temp[m+1].num,newinfo.num); strcpy(temp[m+1].name,newinfo.name); strcpy(temp[m+1].phonenum,newinfo.phonenum); strcpy(temp[m+1].address,newinfo.address); n++; Disp(temp,n); printf("\n\n");getchar(); return n; } void SelectSort(RECORD temp[],int n) { int i=0,j=0,flag=0,indexmin,select; char charflag[10]; RECORD newinfo; if(n<=0) { system("cls"); printf("\n=>Not record!\n"); getchar(); return ; } system("cls"); Disp(temp,n); /*显示排序前的所有记录*/ printf("\n =>1 SORT by num =>2 SORT by another way \n"); printf(" Please choice[1,2]:"); scanf("%d",&select); if(select==1) /*按记录编号排序*/ { for(i=0;i<n-1;i++) { flag=32767; indexmin=0; for(j=i;j<n;j++) { if(atoi(temp[j].num)<flag) { flag=atoi(temp[j].num); indexmin=j; } } strcpy(newinfo.num,temp[i].num); /*利用结构变量nesinfo实现数组元素的交换*/ strcpy(newinfo.name,temp[i].name); strcpy(newinfo.phonenum,temp[i].phonenum); strcpy(newinfo.address,temp[i].address); strcpy(temp[i].num,temp[indexmin].num); strcpy(temp[i].name,temp[indexmin].name); strcpy(temp[i].phonenum,temp[indexmin].phonenum); strcpy(temp[i].address,temp[indexmin].address); strcpy(temp[indexmin].num,newinfo.num); strcpy(temp[indexmin].name,newinfo.name); strcpy(temp[indexmin].phonenum,newinfo.phonenum); strcpy(temp[indexmin].address,newinfo.address); } Disp(temp,n); /*显示排序后的所有记录*/ saveflag=1; printf("\n=>Sort complete!\n");getchar(); return; } else if(select==2) { for(i=0;i<n-1;i++) { charflag[0]=255; indexmin=0; strcpy(newinfo.num,temp[i].num); /*利用结构变量nesinfo实现数组元素的交换*/ strcpy(newinfo.name,temp[i].name); strcpy(newinfo.phonenum,temp[i].phonenum); strcpy(newinfo.address,temp[i].address); strcpy(temp[i].num,temp[indexmin].num); strcpy(temp[i].name,temp[indexmin].name); strcpy(temp[i].phonenum,temp[indexmin].phonenum); strcpy(temp[i].address,temp[indexmin].address); strcpy(temp[indexmin].num,newinfo.num); strcpy(temp[indexmin].name,newinfo.name); strcpy(temp[indexmin].phonenum,newinfo.phonenum); strcpy(temp[indexmin].address,newinfo.address); } Disp(temp,n); /*显示排序后的所有记录*/ saveflag=1; printf("\n=>Sort complete!\n");getchar(); return; } else { Wrong(); getchar(); getchar(); return; } } void Save(RECORD temp[],int n) { int i=0; FILE *fp; fp=fopen("c:\\record.txt","w"); /*以只写方式打开文本文件*/ if(fp==NULL) /*打开文件失败*/ { printf("\n=>Open file error!\n"); getchar(); return; } for(i=0;i<n;i++) { if(fwrite(&temp[i],sizeof(RECORD),1,fp)==1) /*每次写一条记录或一个结构数组元素至文件*/ { continue; } else { break; } } if(i>0) { getchar(); printf("\n\n=>Save file complete,total saved's record number is:%d\n",i); getchar(); saveflag=0; } else { system("cls"); printf("The current link is empty,no menu record is saved!\n"); getchar(); } fclose(fp); /*关闭此文件*/ }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值