个人帐簿管理系统记录某人每月的全部收入及各项开支情况,包括食品消费,房租,子女教育费用,水电费,医疗费,储蓄等。进入系统后可以输入和修改某月的收支情况,可以对每月的开支从小到大进行排序,可以根据输入的月份查询每月的收支情况。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*账户开支信息*/
struct Count{
int month; //月份
float income; //总收入
float outcom; //总支出
float food; //食品消费
float rent; //房租
float education; //子女教育费
float water; //水电费
float hospital; //医疗费
float save; //储蓄
float other; //其他
};
/*个人账户每月详细开支信息*/
struct Node;
typedef struct Node *pNode;
struct Node {
struct Count acount; //账户各项数据
pNode nodelink; //账户按月开支的节点
};
typedef struct Node *LinkList;
/*已经存在的账户*/
struct CountList;
typedef struct CountList* PCountList;
struct CountList {
char name[20]; //账户名
LinkList llink; //指向账户每月账单信息的头节点
PCountList pclink; //指向下一个账户
};
void Menu();
void NewCount();
void SearchCount();
int IsCountExist(char* name);
void AddMonthData(PCountList pcount);
LinkList creatNullLinkList();
PCountList CreatNullCountList();
FILE *fp;
int i,mon;
PCountList CreatNullCountList() {
PCountList pclist;
pclist =