资源描述:
《合同管理系统c语言代码》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、/*合同管理系统*//******头文件(.h)***********/#include#include#include#include"ctype.h"#defineM50structaddressbook{intnum;charname[20];floatmoney[20];charjia[15];charyi[15];intcreatline[15];intdeadline[15];charcarryout[15];charclassify[15
2、];};typedefstructaddressbookAddressBook;intInit(AddressBookt[]);intAddRecord(AddressBookt[],intn);voidList(AddressBookt[],intn);voidSearchOnName(AddressBookt[],intn);voidchangeOnName(AddressBookt[],intn);intDeleteonname(AddressBookt[],intn);voidSortOnNum(Ad
3、dressBookt[],intn);intquantityonjia(AddressBookt[]);voidSaveRecord(AddressBookt[],intn);intLoadRecord(AddressBookt[]);intMenu_select();voidmain(){AddressBookadr[M];intlength;while(1){switch(Menu_select()){case1:length=Init(adr);SaveRecord(adr,length);break;
4、case2:length=LoadRecord(adr);AddRecord(adr,length);break;case3:length=LoadRecord(adr);List(adr,length);break;case4:length=LoadRecord(adr);SearchOnName(adr,length);break;case5:length=LoadRecord(adr);changeOnName(adr,length);SaveRecord(adr,length);List(adr,le
5、ngth);break;case6:length=LoadRecord(adr);Deleteonname(adr,length);SaveRecord(adr,length);List(adr,length);break;case7:length=LoadRecord(adr);SortOnNum(adr,length);SaveRecord(adr,length);List(adr,length);break;case8:length=LoadRecord(adr);quantityonjia(adr,l
6、ength);break;case0:exit(0);/*如返回值为0则程序结束*/}}}intMenu_select(){intc;printf("pressanykeyentermenu......");getchar();/*读入任意字符*/printf("********************************MENU*********************************");printf("1.录入初始记录");printf("2.增加记录");printf(
7、"3.显示所有记录");printf("4.根据合同名称查找记录");printf("5.根据合同名称修改记录");printf("6.根据合同名称删除记录");printf("7.按合同编号从小到大显示记录");printf("8.根据合同甲方统计其合同量数");printf("0.退出");printf("*********************************************************************");do{printf("
8、Enteryourchoice(0-8):");if(scanf("%d",&c)!=1){while(getchar()!='')continue;/*continue;*/}}while(c<0
9、
10、c>8);returnc;}intInit(AddressBookt[]){inti,n;system("cls");printf("请输入要输入的记录数:");scanf("%d",&n