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