个人记账管理系统.doc
更新时间:2023-04-22 02:08:01 阅读量: 实用文档 文档下载
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
#include "string.h"
#include "math.h"
#define TIAOSHU 100
#define CHENGGONG 1
#define SHIBAI 0
struct shouzhixinxi
{
char xingming[20];
char laiyuan[40];
char riqi[20];
char shumu[10];
}jilu[TIAOSHU];
char xuanze;
int tishi;
int dijitiao=0;
int i;
char linshi[40];
double linshi2;
void baocun()
{
FILE *fp;
if((fp=fopen("e:\shouzhiguanli.txt","w+"))==NULL)
{printf("cannot open file\n");
return;
}
for(i=0;i<=TIAOSHU;i++)
if(fwrite(&jilu[i],sizeof(struct shouzhixinxi),1,fp)!=1)
printf("wei jian chuan jian shi bai");
fclose(fp);
}
int shuchu(int i)
{
printf("\n\n
\37~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\37\n");
printf(" \23 \3.shou zhi ren xing ming%-20s\23\n",jilu[i].xingming); printf(" \23 \3.shou zhi lai yuan huo qu xian:%-17s\23\n",jilu[i].laiyuan); printf(" \23 \3.shou zhi ri qi:%-26s\23\n",jilu[i].riqi);
printf(" \23 \3.shou zhi shu mu:%-26s\23\n",jilu[i].shumu);
printf(" \36~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\36\n"); return CHENGGONG;
}
void xinzeng()
{
int shumu;
void zihanshu();
printf("\n");
printf("qing shu ru xin xi tiao shu:\n");
scanf("%d",&shumu);
for(i=1;i<=shumu;i++)
{
printf("\nqing shu ru shou ru huo zhi chu ren yuan de xing ming:");
scanf("%s",jilu[i].xingming);
printf("\nqing shu ru shou ru lai yuan huo zhi chu qu xian:");
scanf("%s",jilu[i].laiyuan);
printf("\nqing shu ru shou ru huo zhi chu de ri qi:");
scanf("%s",jilu[i].riqi);
printf("\nqing shu ru shou ru huo zhi chu de shu mu:");
scanf("%s",jilu[i].shumu);
printf("qing shu ru xia yi tiao:\n");
}
for(i=1;i<=shumu;i++)
{
printf("***********wo shu ru de xin xi*****************");
printf("\n");
printf("%s",jilu[i].xingming);
printf("\n");
printf("%s",jilu[i].laiyuan);
printf("\n");
printf("%s",jilu[i].riqi);
printf("\n");
printf("%s",jilu[i].shumu);
printf("\n");
printf("____________________________________\n");
}
printf("shi fou bao cun zhe tiao xin xi? <Y/N>\n");
xuanze=getch();
if(xuanze=='Y' || xuanze=='y')
{
baocun();
}
else
{
zihanshu();
}
zihanshu();
}
void shanchu()
{
void zihanshu();
int xuhao=0,biaoshi[20]={-1};
while(1)
{
printf("\nqing xuan ze shan chu de fang shi: 1.xing ming i yuan huo qu xian 3.ri qi 4.shu mu\n");
xuanze=getch();
xuanze=xuanze-48;
switch(xuanze)
{
case 1:
printf("qing shu ru yao cha xun de xing ming:");
scanf("%s",linshi);
for(i=0;i< TIAOSHU;i++)
if(strcmp(jilu[i].xingming,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 2:
printf("qing shu ru yao cha xun de lai yuan huo qu xian:");
scanf("%s",linshi);
for(i=0;i< TIAOSHU;i++)
if(strcmp(jilu[i].laiyuan,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 3:
printf("qing shu ru yao cha xun de ri qi:");
scanf("%s",linshi);
for(i=0;i< TIAOSHU;i++)
if(strcmp(jilu[i].riqi,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 4:
printf("qing shu ru yao cha xun de shu mu:");
scanf("%s",linshi);
for(i=0;i< TIAOSHU;i++)
if(strcmp(jilu[i].shumu,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
default:printf("shu ru cuo wu\n");
}
printf("qing shu ru dui ying ji lu:");
xuanze=getch();
printf("\n");
xuanze=xuanze-48;
if(biaoshi[xuanze]!=-1 && xuanze<=xuhao && xuanze>0)
{
biaoshi[0]=biaoshi[xuanze];
printf("que ren shan chu? <Y/N> \n");
xuanze=getch();
if(xuanze=='Y' || xuanze=='y')
{
strcpy(jilu[biaoshi[0]].xingming,"\0");
strcpy(jilu[biaoshi[0]].laiyuan,"\0");
strcpy(jilu[biaoshi[0]].riqi,"\0");
strcpy(jilu[biaoshi[0]].shumu,"\0");
printf("shan chu cheng gong\n");
}
}
else printf("shan chu cheng gong\n");
printf("shi fou ji xu shan chu? <Y/N> \n");
xuanze=getch();
printf("\n");
if(xuanze=='N' || xuanze=='n')
zihanshu();
}
}
void xiugai()
{
void zihanshu();
struct shouzhixinxi linshijilu;
int xuhao=0,biaoshi[20]={-1};
while(1)
{
printf("\nqing xuan ze cha xun yao xiu gai de ji lu fang shi: 1.xing ming
3.ri qi 4.shu mu\n");
xuanze=getch();
xuanze=xuanze-48;
switch(xuanze)
{
case 1:
printf("qing shu ru yao cha xun de xingming:");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].xingming,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n"); i yuan he qu chu
break;
case 2:
printf("qing shu ru yao cha xun de lai yuan huo qu xian:");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].laiyuan,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 3:
printf("qin shu ru yao cha xun de ri qi :");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].riqi,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 4:
printf("qing shu ru yao cha xun de shu mu:");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].shumu,linshi)==0)
{
xuhao++;
biaoshi[xuhao]=i;
printf("\n\n%10d.->",xuhao);
tishi=shuchu(i);
}
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
default:printf("shu ru cuo wu\n");
}
printf("qing shu ru dui ying de xu hao:");
xuanze=getch();
xuanze=xuanze-48;
if(biaoshi[xuanze]!=-1 && xuanze<=xuhao && xuanze>0)
{
biaoshi[0]=biaoshi[xuanze];
printf("\nqing shu ru xin xing ming:");
scanf("%s",linshijilu.xingming);
printf("\nqing shu ru xin shou ru lai yuan huo zhi chu qu xian:");
scanf("%s",iyuan);
printf("\nqing shu ru xin shou ru huo zhi chu de ri qi:");
scanf("%s",linshijilu.riqi);
printf("\nqing shu ru xin shou ru huo zhi chu de shu mu:");
scanf("%s",linshijilu.shumu);
printf("que ren xiu gai? <Y/N> \n");
xuanze=getch();
if(xuanze=='Y' || xuanze=='y')
{
strcpy(jilu[biaoshi[0]].xingming,linshijilu.xingming);
strcpy(jilu[biaoshi[0]].laiyuan,iyuan);
strcpy(jilu[biaoshi[0]].riqi,linshijilu.riqi);
strcpy(jilu[biaoshi[0]].shumu,linshijilu.shumu);
printf("xiu gai cheng gong\n");
}
}
else printf("shu ru cuo wu.\n");
printf("shi fou ji xu xiu gai? <Y/N> \n");
xuanze=getch();
printf("\n");
if(xuanze=='N' || xuanze=='n')
zihanshu();
}
}
void chaxun(void)
{
void zhuhanshu();
while(1)
{
printf("\nqing xuan ze cha xun fang shi : 1.xing ming i yuan huo qu xian 3.ri qi 4.shu mu\n");
xuanze=getch();
xuanze=xuanze-48;
switch(xuanze)
{
case 1:
printf("qing shu ru yao cha xun de xing ming:");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].xingming,linshi)==0)
tishi=shuchu(i);
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 2:
printf("qing shu ru yao cha xun de lai yuan huo qu xian :");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].laiyuan,linshi)==0)
tishi=shuchu(i);
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 3:
printf("qing shu ru yao cha xun de ri qi:");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].riqi,linshi)==0)
tishi=shuchu(i);
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
case 4:
printf("qing shu ru yao cha xun de shu mu:");
scanf("%s",linshi);
for(i=0;i<100;i++)
if(strcmp(jilu[i].shumu,linshi)==0)
tishi=shuchu(i);
if(tishi!=CHENGGONG)
printf("wei zhao dao xiang guan ji lu\n");
break;
default:printf("shu ru cuo wu\n");
}
printf("shi fou ji xu cha xun? <Y/N>");
xuanze=getch();
if(xuanze=='N' || xuanze=='n')
zhuhanshu();
}
}
void tuichu()
{
system("cls");
printf("\n\n\n\n\n\n\t\tgan xie shi yong!\n\n\t\tren yi jian tui chu. ");
getch();
system("cls");
exit(0);
}
void genggaimima()
{
void xiugaimi();
FILE *fp;
int i,t=0;
char mima1[20]={'\0'},mima2[20]={'\0'};
system("cls");
printf("\n\n\n\n\t\tset the old code");
for(i=1;i<=3;i++)
{
scanf("%s",mima1);
fp=fopen("mima.t","r");
fscanf(fp,"%s",mima2);
fclose(fp);
if(strcmp(mima1,mima2)!=0)
{
system ("cls");
printf("\n\n\n\n\n\t\tsorry,the code is wrong,please set again!");
}
else
{
xiugaimi();
break;
}
printf("\n\n\t\t\ttset the old code");
}
if(i>3)
{
system("cls");
printf("\n\n\n\n\n\n\t\t\texit!");
getch();
system ("cls");
exit(0);
}
}
void xiugaimi()
{
void zhuhanshu();
FILE *fp;
char xuanze;
int t=0;
char mima1[20]={'\0'},mima2[20]={'\0'};
printf("\n\n\n\n\t\tset the new code:");
scanf("%s",mima1);
printf("\n\n\t\tset again:");
scanf("%s",mima2);
if(!strcmp(mima1,mima2))
{
printf("\n\n\t\tyour new code is %s,please remember!\n\t\tpress any key back",mima1); xuanze=getch();
fp=fopen("mima.t","w");
fclose(fp);
fp=fopen("mima.t","a");
fprintf(fp,"%s",mima1);
fclose(fp);
system("cls");
zhuhanshu();
}
else
{
printf("\n\n\t\tthe two is different.\n\t\tpress any key back.");
getch();
system ("cls");
zhuhanshu();
}
}
void zihanshu()
{
char xuanze;
void zhuhanshu();
void zicaidan();
zicaidan ();
xuanze=getch();
for(;xuanze!='1'&&xuanze!='2'&&xuanze!='3'&&xuanze!='4';)
xuanze=getch();
switch(xuanze)
{
case'1':xinzeng();break;
case'2':xiugai();break;
case'3':shanchu();break;
case'4':zhuhanshu();break;
}
}
void zhuhanshu()
{
char xuanze;
void zhucaidan();
zhucaidan();
xuanze=getch();
for(;xuanze!='1'&&xuanze!='2'&&xuanze!='3'&&xuanze!='4';)
xuanze=getch();
switch(xuanze)
{
case '1':zihanshu();break;
case '2':chaxun();break;
case '3':genggaimima();break;
case '4':tuichu();break;
}
}
void denglu()
{
FILE *fp;
int i,t=0;
char mima1[20]={'\0'},mima2[20]={'\0'};
if((fp=fopen("mima.t","r"))==NULL)
{
t=1;
fp=fopen("mima.t","w");
fclose(fp);
}
if(t==1)
{
printf("\n\n\t\tyou have no code,please set it!\n\n\t\t\tset:");
scanf("%s",mima1);
printf("\n set again:");
scanf("%s",mima2);
for(;;)
{
if(!strcmp(mima1,mima2))
{ fp=fopen("mima.t","a"); fprintf(fp,"%s",mima1); fclose(fp); printf("\n\t\t\you code:%shas been done!\n\t\tpress any key to inter",mima1); getch(); zhuhanshu(); break; } else { printf("\n\n\t\tthe two has different!\n\t\t\tplease set"); scanf("%s",mima1); printf("\t\t\t\tset again"); scanf("%s",mima2); } } } else { printf("\n\n\n\n\t\t\t\tset:"); for(i=0;i<3;i++) { scanf("%s",mima1); fp=fopen("mima.t","r"); fscanf(fp,"%s",mima2); fclose(fp); if(strcmp(mima1,mima2)!=0) { system ("cls"); printf("\n\n\n\n\t\tsorry,the code is wrong,please set again!"); } else { zhuhanshu(); break; } printf("\n\n\t\t\t\tset:"); } } if(i==3) { system("cls"); printf("\n\n\n\n\n\n\t\t\t\texit!");
getch();
system ("cls");
exit(0);
}
}
int main()
{
void denglu();
denglu();
}
void zhucaidan()
{
system ("cls");
printf("\n\n");
printf("\t==============================MENU==============================");
printf("\n\n");
printf("\n\t\t\t\t1.jiaoyiguanli\n");
printf("\n\t\t\t\t2.chaxun\n");
printf("\n\t\t\t\t3.genggaimima\n");
printf("\n\t\t\t\t4.Exit\n");
printf("\n\n");
printf("\t================================================================");
printf("\n\n");
printf("Please set:");
return;
}
void zicaidan()
{
system ("cls");
printf("\n\n");
printf("\t==============================MENU==============================");
printf("\n\n");
printf("\n\t\t\t\t1.xinzeng\n");
printf("\n\t\t\t\t2.xiugai\n");
printf("\n\t\t\t\t3.shanchu\n");
printf("\n\t\t\t\t4.fanhui\n");
printf("\n\n");
printf("\t================================================================");
printf("\n\n");
printf("Please set:");
return;
}
正在阅读:
个人记账管理系统.doc04-22
附1 自治区发展党员工作规程(汉文)11-27
警械使用、搜身押解技术教学方案05-13
物业报价计算方法03-21
李涵虚 黄庭内外景经注解 丹道资料,05-02
不拘形式地说写见闻06-05
图解项目管理习题答案12-05
如果让我再读一次研究生!!(转给所有研究生和即将进入研究生阶03-08
初三学生膳食平衡调查报告01-25
2011XX公司安康杯活动总结08-12
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- 记账
- 管理系统
- 个人
- doc
- 中级财务会计学 第九章 无形资产及其他资产
- PatMan A Visual Database System to Manipulate Path Patterns
- 培养农村小学生良好行为习惯
- 竣工结算条件会签表
- 全国高校名录、专业目录
- 三联疗法治疗十二指肠溃疡
- 五大连池矿泉水配额经营权成功挂牌出让——哈药集团制药六厂以16
- 宽带路由器故障巧排除1
- 华中科技大学成绩单中英文标准模版
- (五)怎样写科研论文
- Quark Pair Production in the Chiral Phase Transition
- 2013年基本公共卫生服务项目实施方案
- 高龄骨折患者围手术期护理
- 8月保险公司投资收益情况综述
- 教科版小学科学五年级上册教案(修改稿)
- 专业文献管理工具NE的使用方法
- 电气控制系统与可编程控制器 第4章
- 三毛与荷西的爱情故事
- 恩格尔注塑机常见的几种故障(自行判断处理)
- 仁爱版 七年级 教案 Unit1 Topic2 Section A B C D