资源描述:
《C语言个人收支系统.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、C语言个人收支系统.txt15成熟的麦子低垂着头,那是在教我们谦逊;一群蚂蚁能抬走大骨头,那是在教我们团结;温柔的水滴穿岩石,那是在教我们坚韧;蜜蜂在花丛中忙碌,那是在教我们勤劳。#include"stdio.h"#include"string.h"#defineM100structstu{charuser[10];//用户名charcipher[10];//密码structIncome;structExpense;};structIncome{floatgongzi;floatjiangjin;floatjintie;floatzhongjia
2、ng;floattotal1;};structExpense{floatshuidian;floattongxun;floathuoshi;floatjiaoji;floatlvyou;floatfangzu;floattotal2;};charuser[][10]={"liwenjian","wangsiyao","wuchao"},cipher[][6]={"123","456","789"};intindex=0;intenter(structstus[],structIncomeI[],structExpenseE[]);voidprin
3、t(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc);voidsearch(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc);intinsert(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc);intdel(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc
4、);voidsave(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc);intload(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc);voidmodify(structstus[],inta,structIncomeI[],intb,structExpenseE[],intc);voidsort(structstus[],inta,structIncomeI[],intb,structExpens
5、eE[],intc);intmenu();intmain(){structstuperson[M];intlength;for(;;)switch(menu())//调用主菜单函数,返回值为整数,作开关语句的条件{case1:length=enter(person);break;//输入记录case2:print(person,length);break;//显示全部记录case3:search(person,length);break;//查找记录case4:length=insert(person,length);break;//插入记录ca
6、se5:length=del(person,length);break;//删除记录case6:save(person,length);break;//保存文件case7:length=load(person);break;//读文件case8:sort(person,length);break;//排序case9:modify(person,length);break;//修改记录信息case10:return0;//如果菜单返回值为10,则程序结束}}intmenu(){intchoice;printf("MENU");printf("*
7、********************************");printf("1.输入有户名及密码");//输入记录printf("2.显示所有记录");//显示所有记录printf("3.按用户名查找记录");//按用户名查找记录printf("4.插入记录");//插入记录到数组中printf("5.删除记录");printf("6.保存文件");//将数组中的记录保存到文件中printf("7.从文件中读文件");//从文件中读入记录printf("8.排序");//排序printf("9.修改记录信
8、息");//修改记录信息printf("10.退出");//退出printf("************************