欢迎来到天天文库
浏览记录
ID:51304134
大小:15.51 KB
页数:11页
时间:2020-03-10
《C语言程序设计-物业管理系统.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include"stdio.h"#include"stdlib.h"#include"string.h"#defineM5structPeople{inta;charming[30];charxiang[30];intb;intc;}P[M];voidmain(){inta=1;voidmenu_1(inta);menu_1(a);}voidmenu_1(inta){voidmenu_2();voidmenu_3();voidbiao_1();intloop=1;while(loop){system("cls");printf("t
2、WELCOME");printf("t--------------------(*^◎^*)--------------------");printf("t--");printf("t--");printf("t-1.小区用户管理-");printf("t-2.物业收费管理-");printf("t-3.生成小区住户收费报表-");printf("t-4.退出-");printf("t--");printf("t--");printf("t-------------------
3、o(╯□╰)o-------------------");printf("tEND");printf("请输入所要选择内容的序号(1-4):[]bb");scanf("%d",&a);switch(a){case1:menu_2();break;case2:menu_3();break;case3:biao_1();break;case4:exit(0);break;default:exit(0);}getchar();getchar();}}voidmenu_2(){voidscan_1();voidadd_1();vo
4、idrewrite_1();voiddelete_1();voidseek_1();inta;system("cls");printf("t*欢迎使用小区用户管理系统*");printf("t-----------------↖(^ω^)↗---------------------");printf("t--");printf("t--");printf("t-1.浏览用户资料-");printf("t-2.录入用户资料-");printf("t-3.更改用户资料-");printf("t-4
5、.删除用户资料-");printf("t-5.查找用户资料-");printf("t--");printf("t--");printf("t-----------------O(∩_∩)O~---------------------");printf("tEND");printf("请输入所要选择内容的序号(1-3):[]bb");scanf("%d",&a);switch(a){case1:scan_1();break;case2:add_1();break;case3:rewrite_1();b
6、reak;case4:delete_1();break;case5:seek_1();break;default:exit(0);}}voidscan_1(){FILE*fp;charch;if((fp=fopen("e:\data.txt","r+"))==NULL){printf("cannotopenthefile!");exit(0);}ch=fgetc(fp);while(ch!=EOF){putchar(ch);ch=fgetc(fp);}fclose(fp);printf("");}voidadd_1(){FILE*
7、fp;if((fp=fopen("e:\data.txt","a"))==NULL){printf("文件不能打开/n");exit(0);}else{inti;intnum;printf("输入所要输入数据的数目=");scanf("%d",&num);for(i=2;i8、scanf("%d",&P[i].b);printf("已欠:");scanf("%d",&P[i].c);fprintf(fp,"%d%s%s%d%d",P[i].a,P[i].ming,P[i].xia
8、scanf("%d",&P[i].b);printf("已欠:");scanf("%d",&P[i].c);fprintf(fp,"%d%s%s%d%d",P[i].a,P[i].ming,P[i].xia
此文档下载收益归作者所有