strcpy(tongxunlu[j-1].tel,tongxunlu[j].tel); strcpy(tongxunlu[j].tel,temp); strcpy(temp,tongxunlu[j-1].mail); strcpy(tongxunlu[j-1].mail,tongxunlu[j].mail); strcpy(tongxunlu[j].mail,temp); } } }
void insert()//新增联系人信息 {
int i=n,j,flag; //定义变量
printf(\请输入待增加的联系人数:\\n\scanf(\do { flag=1; while(flag) { flag=0;
for(j=0;j
printf(\请输入第 %d 个联系人的姓名:\\n\ printf(\请输入第 %d 个联系人的性别:\\n\ printf(\请输入第 %d 个联系人的地址:\\n\ printf(\请输入第 %d 个联系人的电话:\\n\
printf(\请输入第 %d 个联系人的E-mail:\\n\scanf(\if(flag==0) { i=i; i++; } }
while(i printf(\录入完毕!\\n\\n\ void del() //删除联系人 { int i,j,flag=0; char s1[LEN+1]; //定义变量 printf(\请输入要删除联系人的号码:\\n\ if(strcmp(tongxunlu[i].tel,s1)==0) { flag=1; //比较字符串 for(j=i;j for(i=0;i } } void save() //数据的存储 { int i; FILE *fp; //声明fp是FILE型指针 fp=fopen(\输入数据的写入 for(i=0;i } fclose(fp); } void menu()//系统登录界面 { int num; printf(\ printf(\ 通 讯 录 信 息 管 理 系 统 \\n\\n\ printf(\ printf(\系统功能菜单*******************\\n\ printf(\ printf(\ printf(\刷新联系人**************2.查询联系人*****\\n\ printf(\修改联系人**************4.增加联系人*****\\n\ printf(\删除联系人**************6.显示当前联系人*\\n\ printf(\保存当前学生信息********8.退出系统*******\\n\ printf(\ printf(\ 请输入操作序号:\ scanf(\ switch(num) //对应选项的操作 { case 1:readfile();break; //联系人数据的读取录入 case 2:seek();break;//联系人数据的查询 case 3:modify();break;//联系人数据的修改 case 4:insert();break;//增加联系人数据 case 5:del();break; //删除联系人 case 6:display();break; case 7:save();break; case 8:k=0;break; default:printf(\请在1-8之间选择\\n\ } return; } 题目二源代码 #include getch(); return 0; } if(a==p&&b==q&&c==r&&d==s&&e==t) { printf(\恭喜您中了二等奖,按任意键结束\\n\ getch();return 0; } if(b==o&&c==p&&d==q&&e==r&&f==s) { printf(\恭喜您中了二等奖,按任意键结束\\n\ getch();return 0; } if(a!=o&&b==p&&c==q&&d==r&&e==s&&f==t) { printf(\恭喜您中了二等奖,按任意键结束\\n\ getch();return 0; } //中三等奖的情况 if(a==o&&b==p&&c==q&&d==r&&e!=s) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(b==o&&c==p&&d==q&&e==r&&f!=s) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(c==o&&d==p&&e==q&&f==r) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(a==p&&b==q&&c==r&&d==s&&e!=t) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(a!=o&&b==p&&c==q&&d==r&&e==s&&f!=t) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(b!=o&&c==p&&d==q&&e==r&&f==s) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch();return 0; } if(a==q&&b==r&&c==s&&d==t) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(a!=p&&b==q&&c==r&&d==s&&e==t) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch(); return 0; } if(b!=p&&c==q&&d==r&&e==s&&f==t) { printf(\恭喜您中了三等奖,按任意键结束\\n\ getch();return 0; } //中四等奖情况 if(a==o&&b==p&&c==q&&d!=r) { printf(\恭喜您中了四等奖,按任意键结束\\n\ getch(); return 0; } if(b==o&&c==p&&d==q&&e!=r) { printf(\恭喜您中了四等奖,按任意键结束\\n\ getch();