rintf(" +---------------+\n");Р?while(1)Р?{Р printf("\n 请选择(0~6):");Р scanf("%d",&sn);Р printf("\n");Р if(sn<0||sn>6)Р printf("\n输入错误!");Р elseР break;Р?}Р?return sn;Р}Рvoid handle_menu()//根据选择不同的处理函数Р{Р?int sn;Р?while(1)Р?{Р sn=menu_select();Р switch(sn)Р {Р case 1:Р display_all();Р break;Р case 2:Р append_data();Р break;Р case 3:Р modify_data();Р break;Р case 4:Р if(!search_byid("删除"))Р {Р delete_data();Р }Р elseР printf("对不起,没有查到要删除的业主!");Р break;Р case 5:Р if(search_byid("查询")==0)Р display_data(1);Р elseР printf("对不起,没有查到");Р break;Р case 6:Р sort_data();Р break;Р case 0:Р printf("再见!\n");Р }Р if(sn==0)Р break;Р?}Р}Рvoid main()//主函数Р{Р?system("color 9B");Р?if((fp=fopen(datafilename,"rb+"))==NULL)Р?{Р fp=fopen(datafilename,"wb+");Р?}Р?handle_menu();Р?fclose(fp);Р}Р4.2增添系统模块实现Р4.21增添系统测试