c语言程序设计 商品订购系统

来源:百度知道 编辑:UC知道 时间:2024/09/23 11:18:13
屏幕上出现一个界面,让顾客或输入商品名称,或商品型号,或选择列表进而输入商品编号都可以,如查到所选商品,则列出商品编号,商品名称,商品型号,商品价格,商品产地,库存数量和已订购数量;然后给出所选流程:所选商品编号--列出对应商品的信息--要求顾客输入邮件地址信息--确认订购,是否继续选够其他商品,列出所有选定商品,再次确认订购。确认两个文件,份额吗别存放商品信息与订购信息。

我这里有一个!
具体的,稍微改一下就可以了!

#include "stdio.h" /*I/O函数*/
#include "stdlib.h" /*其它说明*/
#include "string.h" /*字符串函数*/
#include "conio.h" /*屏幕操作函数*/
#include "mem.h" /*内存操作函数*/
#include "ctype.h" /*字符操作函数*/
#include "alloc.h" /*动态地址分配函数*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");