user-0 提问: 简易离线外卖C语言设计

回复:
user: user-0
content: 这个就是我编的代码  求帮忙改一下     #include<stdio.h> #include<stdlib.h> #include<string.h> #include<conio.h>  struct bookdata { 	char name[20]; 	char writer[20]; 	char number[20]; }contact[500];  int No=0; FILE *fp;  void mainmenu(); void hotmenu(); void joinone(); void jointwo(); void joinstree(); void searchmenu(); void searchname(); void searchnumber(); int loadfile();  int main() { 	printf("欢迎进入\n"); 	system("cls"); 	loadfile(); 	while(1) 	{ 		mainmenu(); 	} 	return 0; }  void mainmenu() { 	char choice; 	system("cls"); 	system("color 4 "); 	printf("\n\t\t\t\t\t************主菜单**************\n"); 	printf("\n\t\t\t\t\t**********1-搜索店家**********\n"); 	printf("\n\t\t\t\t\t**********2-热门店家**********\n"); 	printf("\n\t\t\t\t\t**********0-返回主菜单**********\n");     printf("\n\t\t\t\t\t*************************************\n"); 	printf("\n\t\t\t\t\t请选择："); 	choice=getch();//从控制台读取一个字符 	switch(choice) 	{ 		case '1':searchmenu();break; 		case '2':hotmenu();break; 		case '0':exit(0);break; 		default:mainmenu(); 	} }  void searchmenu() { 	char choice; 	system("cls"); 	system("color 9"); 	printf("\n\t\t\t\t\t************搜索店家************\n"); 	printf("\n\t\t\t\t\t**********1-按店名查找**********\n"); 	printf("\n\t\t\t\t\t**********2-按编号查找**********\n");     printf("\n\t\t\t\t\t**********0-返回主菜单**********\n"); 	printf("\n\t\t\t\t\t********************************\n"); 	printf("请选择：\n"); 	choice=getch(); 	switch(choice) 	{ 		case '1':searchname();break; 		case '2':searchnumber();break; 		case '0':mainmenu();break; 	} }  void searchname() {     system("color A"); 	int mark=0; 	int i; 	int a=0; 	char name[20]; 	printf("\n\t\t\t\t\t**********按店名查找**********\n"); 	printf("\n\t\t\t\t\t请输入关键词："); 	scanf("\t\t\t\t\t%s",name); 	for(i=a;i<No;i++) 	{ 		if(strcmp(contact[i].name,name)==0) 		{ 			printf("\n\t\t\t\t\t**********以下是您要查找书籍的信息**********\n"); 			printf("\n\t\t\t\t\t店名：%s",contact[i].name); 		    printf("\n\t\t\t\t\t编号：%s",contact[i].number); 			printf("\n\t\t\t\t\t********************************************\n"); 			printf("\n\t\t\t\t\t按任意键返回\n"); 			mark++; 			getch(); 			return; 		} 	} 	if(mark==0) 	{ 		printf("\n\t\t\t\t\t没有该店家信息\n"); 		printf("\n\t\t\t\t\t按任意键返回\n"); 		getch(); 		return; 	} 	if(mark==1) 	{ 		printf("\n1-套餐A\t\t\t2-套餐B\t\t\t3-套餐C\n"); 		printf("\n4-卤肉饭\t\t\t5-饮料\t\t\t4-稀饭\n"); 	} 	if(mark==2) 	{ 		printf("\n1-素冒菜\t\t\t\t2-荤冒菜\n"); 		printf("\n3-自选\t\t\t\t4-饮料\n"); 	} 	if(mark==3) 	{ 		printf("\n1-推荐菜系\t\t\t\t2-环保餐盒\n"); 		printf("\n3-自选\t\t\t\t4-推荐饮品\n"); 	} }  void searchnumber() { 	int mark=0; 	int i; 	int a=0; 	char number[20]; 	printf("\n\t\t\t\t\t**********按编号查找**********\n"); 	printf("\n\t\t\t\t\t请输入编号："); 	scanf("\t\t\t\t\t%s",number); 	for(i=a;i<No;i++) 	{ 		if(strcmp(contact[i].number,number)==0) 		{ 			printf("\n\t\t\t\t\t**********以下是您要查找编号的信息**********\n"); 			printf("\n\t\t\t\t\t店名：%s",contact[i].name); 			printf("\n\t\t\t\t\t编号：%s",contact[i].number); 			printf("\n\t\t\t\t\t********************************************\n"); 			printf("\n\t\t\t\t\t按任意键返回\n"); 			mark++; 			getch(); 			return; 		} 	} 	if(mark==0) 	{ 		printf("\n\t\t\t\t\t没有该编号信息\n"); 		printf("\n\t\t\t\t\t按任意键返回\n"); 		getch(); 		return; 	} 	if(mark==1) 	{ 		printf("\n1-套餐A\t\t\t2-套餐B\t\t\t3-套餐C\n"); 		printf("\n4-卤肉饭\t\t\t5-饮料\t\t\t4-稀饭\n"); 	} 	if(mark==2) 	{ 		printf("\n1-素冒菜\t\t\t\t2-荤冒菜\n"); 		printf("\n3-自选\t\t\t\t4-饮料\n"); 	} 	if(mark==3) 	{ 		printf("\n1-推荐菜系\t\t\t\t2-环保餐盒\n"); 		printf("\n3-自选\t\t\t\t4-推荐饮品\n"); 	} } void hotmenu() {     char choice; 	system("cls"); 	system("color 4 ");     printf("\n\t\t\t\t\t************热门店家************\n"); 	printf("\n\t\t\t\t\t**********1-卤肉饭**********\n"); 	printf("\n\t\t\t\t\t**********2-冒菜**********\n");     printf("\n\t\t\t\t\t**********3-麻辣香锅**********\n");     printf("\n\t\t\t\t\t**********0-返回主菜单**********\n"); 	printf("\n\t\t\t\t\t********************************\n"); 	printf("请选择：\n"); 	choice=getch(); 	switch(choice) 	{ 		case '1':joinone();break; 		case '2':jointwo();break; 		case '3':joinstree();break; 		case '0':mainmenu();break; 	} 	return; } void joinone() { 	char number[20]; 	printf("\n\t\t\t\t\t**********按标号选择**********\n"); 	printf("\n1-套餐A\t\t\t2-套餐B\t\t\t3-套餐C\n");     printf("\n4-卤肉饭\t\t\t5-饮料\t\t\t4-稀饭\n");     printf("\n\t\t\t\t\t请输入编号：");     printf("\n\t\t订单已保存!\n"); 	fclose(fp); 	scanf("\t\t\t\t\t%s",number);     printf("\n\t\t\t\t\t按任意键返回\n");     getch();     return; } void jointwo() {int i;     int a=0; 	char number[20]; 	printf("\n\t\t\t\t\t**********按标号选择**********\n");     printf("\n1-推荐菜系\t\t\t\t2-环保餐盒\n");     printf("\n3-自选\t\t\t\t4-推荐饮品\n"); 	printf("\n\t\t\t\t\t请输入编号：");     printf("\n\t\t订单已保存!\n"); 	fclose(fp); scanf("\t\t\t\t\t%s",number); 	printf("\n\t\t\t\t\t按任意键返回\n");     getch();     return; } void joinstree() {int i;     int a=0; 	char number[20]; 	printf("\n\t\t\t\t\t**********按标号选择**********\n"); 	printf("\n1-素冒菜\t\t\t\t2-荤冒菜\n"); 	printf("\n3-自选\t\t\t\t4-饮料\n"); 	printf("\n\t\t\t\t\t请输入编号：");     printf("\n\t\t订单已保存!\n"); 	fclose(fp); scanf("\t\t\t\t\t%s",number); 	printf("\n\t\t\t\t\t按任意键返回\n");     getch();     return; } int loadfile() { 	fseek(fp,0,2); 	if (ftell(fp)>0) 	printf("\n\n\n\n"); 	printf("\n\t\t\t\t\t    欢迎使用饿了么"); 	printf("\n\t\t\t\t\t  按任意键进入主菜单 "); 	getch(); 	return(No); }

user: user-1
content: 目测lz说的是类似学生信息管理系统的那种,实现增删查改的功能

user: user-2
content: 马克，等楼主出具体需求

user: user-3
content: 把需求、输入、期望输出说清楚点吧。

user: user-4
content: 做叫外卖的网站还是APP？

user: user-5
content: 问题描述要稍微清晰一点。不然谁知道你要表达什么啊