欢迎来到天天文库
浏览记录
ID:9403865
大小:74.50 KB
页数:12页
时间:2018-04-30
《c语言程序仓库管理系统》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、#include#include#include#includestructInfo{charnum[20];charname[20];intprice;intamount;};charmenu()/*菜单选择函数*/{charn;/*n记录选择的菜单*/system("cls");puts("tt欢迎来到仓库货物管理系统");puts("tt***********************MENU***********************");p
2、uts("tt*1.录入货物信息*");puts("tt*2.显示货物信息*");puts("tt*3.查找货物信息*");puts("tt*4.修改货物信息*");puts("tt*5.删除货物信息*");puts("tt*6.退出系统*");puts("tt**************************************************");puts("*********************************");printf("*请选择你要输入数
3、(1-6):*");puts("*********************************");while(1){n=getchar();getchar();if(n<'1'
4、
5、n>'6'){puts("**********************************");printf("*出错了!请再次输入(1-6):*");puts("**********************************");}elsebreak;}returnn;}voidappend()/*货物信息输入函数*/{structI
6、nfoinfo;FILE*fp;charch;if((fp=fopen("F:\test\filemolde\123.txt","wb"))==NULL){printf("******************");printf("*不能打开文件!*");printf("******************");getch();exit(1);}do{printf("tnum:");gets(info.num);printf("tname:");gets(info.name);printf("tprice:");s
7、canf("%d",&info.price);printf("tamount:");scanf("%d",&info.amount);getchar();fwrite(&info,sizeof(info),1,fp);printf("***************************");printf("*还需要输入吗?(Y/N):*");printf("***************************");ch=getchar();getchar();}while(ch=='Y'
8、
9、ch=='y');fclos
10、e(fp);}voidprintf1(){printf("*************************************************************************");printf("tt%-10st%-10st%-10st%-10s","num","name","price","amount");printf("*************************************************************************");}vo
11、idprintf2(structInfoinfo){printf("-------------------------------------------------------------------------");printf("tt%-10st%-10st%-10dt%-10d",info.num,info.name,info.price,info.amount);printf("------------------------------------------------------------------
12、-------");}voiddisplay()/*货物信息显示函数*/{structInfoinfo;FILE*fp;intm=0;if((fp=fopen("F:\test\filemolde
此文档下载收益归作者所有