switch(select4) {
case '1':a.list1();
cout<<\返回还是回到主菜单(T为退出,R为回到主菜单,不计大小写): \
char back; cin>>back;
if(back=='R'||back=='r') goto top; else
goto bottom; break;
case '2':a.list2();
cout<<\返回还是回到主菜单(T为退出,R为回到主菜单,不计大小写): \
char back1; cin>>back1;
if(back1=='R'||back1=='r') goto top; else
goto bottom; break; }
break;
case '5':a.read();
cout<<\返回还是回到主菜单(T为退出,R为回到主菜单,不计大小写): \
char back_r; cin>>back_r;
if(back_r=='R'||back_r=='r') goto top; else
goto bottom; break;
case '6':cout<<\请确认删除所有资料!(Y/N) \ char select5; cin>>select5;
if(select5=='Y'||select5=='y') a.format();
cout<<\返回还是回到主菜单(T为退出,R为回到主菜单,不计大小写): \
char back_f; cin>>back_f;
if(back_f=='R'||back_f=='r')
11
goto top; else
goto bottom; break; }
bottom:cout<<\★★★★★★★★★★★★欢迎使用本软件!★★★★★★★★★★★ \ return 0; }
//添加联系人
void inter::add(char no[13],char name[20],char address[100],char tel_no[12],char post_code[7],char e_mail[40]) {
int x=1;
for(int i=0;i<35;i++) {
if(!strcmp(st[i].no,\ {
strcpy(st[i].address,address); strcpy(st[i].e_mail,e_mail); strcpy(st[i].name,name); strcpy(st[i].no,no);
strcpy(st[i].post_code,post_code); strcpy(st[i].tel_no,tel_no); x=0; }
if(x==0) break; } }
//删除联系人
void inter::del(char name[20]) { int x=1;
for(int i=0;i<35;i++) {
if(!strcmp(st[i].name,name)) {
strcpy(st[i].address,\ strcpy(st[i].e_mail,\ strcpy(st[i].name,\ strcpy(st[i].no,\
strcpy(st[i].post_code,\ strcpy(st[i].tel_no,\ }
12
else x=0; }
if(x==0)
cout<<\输入姓名错误!\}
//修改联系人
int inter::correct(char name[30]) {
int x;
for(int i=0;i<35;i++) {
if(!strcmp(st[i].name,name)) x=i; }
char select;
cout<<\修改姓名:\ cout<<\修改学号:\ cout<<\修改地址:\ cout<<\修改邮编:\ cout<<\修改电话号码:\ cout<<\修改E_MAIL:\ cout<<\请选择:\ cin>>select; switch(select) {
case '1':cout<<\输入要修改的姓名:\ char name1[30]; cin>>name1;
strcpy(st[x].name,name1);
cout<<\修改成功!\ return back(); break;
case '2':cout<<\输入要修改的学号:\ char no1[13]; cin>>no1;
strcpy(st[i].no,no1);
cout<<\修改成功!\ return back(); break;
case '3':cout<<\输入要修改的地址:\ char address1[100]; cin>>address1;
strcpy(st[x].address,address1); cout<<\修改成功!\
13
return back(); break;
case '4':cout<<\输入要修改的邮编:\ char post_code1[7]; cin>>post_code1;
strcpy(st[x].post_code,post_code1); cout<<\修改成功!\ return back(); break;
case '5':cout<<\输入要修改的电话号码:\ char tel_no1[12]; cin>>tel_no1;
strcpy(st[x].tel_no,tel_no1); cout<<\修改成功!\ return back(); break;
case '6':cout<<\输入要修改的E_MAIL:\ char e_mail1[40]; cin>>e_mail1;
strcpy(st[x].e_mail,e_mail1); cout<<\修改成功!\ return back(); break; } }
//按学号查询联系人
void inter::find1(char no[13]) {
int x,y=1,z=1;
for(int i=0;i<35;i++) {
if(!strcmp(st[i].no,no)) {
x=i; z=0; }
else y=0; if(z==0) break; } if(y==0)
cout<<\输入的学号查找不到!!!\ print(x);
14
}
//按姓名查询联系人
void inter::find2(char name[20]) {
int x,y=1,z=1;
for(int i=0;i<35;i++) {
if(!strcmp(st[i].name,name)) {
x=i; z=0; }
else y=0; if(z==0) break; }
if(y==0)
cout<<\输入的姓名查找不到!!!\ print(x); }
//读取文件
void inter::read() {
char name1[20];
cout<<\输入你要导入的文件名: \ cin>>name1;
strcat(name1,\ ifstream file(name1); char line[120]; char no[120]; char name[120]; char address[120]; char post_code[120]; char tel_no[120]; char e_mail[120]; int time=0;
file.getline(line,120); while(!file.eof()) {
for(int k=0;k<35;k++) {
if(time==0) {
strcpy(no,line);
15