可以文档读取的钱包,记录自己的消费记录
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
typedef struct date
{
char date[15];//时间
unsigned int consume;//消费
char where[150];//去向
} Data;
typedef struct cost
{
Data data;
struct cost* next;//下一个结点
} Cost;
Cost *p1=NULL,*p2=NULL,*head=NULL;
unsigned int count=0,money=0,total=0;
int main()
{
void add_record();//新增数据
void see_record();//查看数据
void del_record();//删除数据
void rew_record();//修改数据
void total_record();//统计数据
void output_record();//导出数据
void input_record();//导入数据
void sort_record();//整理数据
void remarks();//寄语
void chang_money();
int i;
FILE *pq;
char password[12]={"332428"},input[12];
pq=fopen("data.dat","rb");//判断是否早已有了数据
if(pq==NULL)
pq=fopen("data.dat","wb");
fclose(pq);
pq=fopen("money.dat","rb");
if(pq==NULL)
pq=fopen("money.dat","wb");
pq=NULL;
printf("请输入我的专属密码\n");
scanf("%s",input);
while(strcmp(password,input)!=0)
{
printf("输入错误,再试试\n");
fflush(stdin);
getchar();
system("cls");
printf("请输入我的专属密码\n");
scanf("%s",input);
}
system("cls");
printf("\n\t\033[32m恭喜你进入了青哥的高大上记录系统\033[32m\n");
printf("\t\033[32m _______ \033[0m\n");
printf("\t\033[32m ,--' `--._ \033[32m\n");
printf("\t\033[32m ( `-.\033[0m\n");
printf("\t\033[32m ,-' _ )\033[0m\n");
printf("\t\033[32m / `. , |\033[0m\n");
printf("\t\033[32m | -.\_(_ __ |\033[0m\n");
printf("\t\033[32m | /\) `----' ( )\033[0m\n");
printf("\t\033[32m | / _____ ___| (\033[0m\n");
printf("\t\033[32m |,-. \ <_____) (__ ; /\033[0m\n");
printf("\t\033[32m |) ) ( (o) (o| (\033[0m\n");
printf("\t\033[32m ( | | ) . | ;\033[0m\n");
printf("\t\033[32m \ \| ( __) |(\033[0m\n");
printf("\t\033[32m ) `--' _____ (__)\033[0m\n");
printf("\t\033[32m `-.| `. `---- /\033[0m\n");
printf("\t\033[32m |`-._`-. (\033[0m\n");
printf("\t\033[32m `- `--^--'\033[0m\n");
fflush(stdin);
getchar();
input_record();
while(1)
{
system("cls");
fflush(stdin);
sort_record();
printf("\033[31m SKY消费管理系统\033[0m\n");
printf("\033[32m------------------------------------------------------------\033[0m\n");
printf("\033[32m| |\033[0m\n");
printf("\033[32m| 1:新增消费记录 |\033[0m\n");
printf("\033[32m| 2:查看消费记录 |\033[0m\n");
printf("\033[32m| 3:删除已有记录 |\033[0m\n");
printf("\033[32m| 4:修改已有记录 |\033[0m\n");
pri