《C语言订餐系统》由会员分享,可在线阅读,更多相关《C语言订餐系统(7页珍藏版)》请在人人文库网上搜索。
1、include #include #include struct consumerchar stu_name30,stu_Place20;/定义客户姓名,地点char stu_time20,stu_madetime20,stu_memu20; /定义用餐时间,订单生成时间,菜单int stu_num; /用餐人数order;void reserve()/订餐int i;printf(请输入客户姓名:);scanf(%s,&order.stu_name);strcat(order.stu_name,.txt);/将后一个字符串加到前一个FILE *fp1=fopen(order.stu_name。
2、,w);/打开文档if(fp1=NULL)/若文件打开失败 printf(文件打开失败n);exit(0);FILE *fp2=fopen(d:总表.txt,a+);/打开文档if(fp2=NULL)/若文件打开失败 printf(文件打开失败n);exit(0);fprintf(fp1,客户姓名:%sn,order.stu_name);fprintf(fp2,客户姓名:%sn,order.stu_name);printf(请输入用餐人数:);scanf(%d,&order.stu_num);fprintf(fp1,用餐人数:%dn,order.stu_num);fprintf(fp2,用餐人。
3、数:%dn,order.stu_num);printf(请输入用餐时间:);scanf(%s,&order.stu_time);fprintf(fp1,用餐时间:%sn,order.stu_time);fprintf(fp2,用餐时间:%sn,order.stu_time);printf(请输入包间或餐桌号:);精品.scanf(%s,&order.stu_Pla