C语言程序设计物业管理系统
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#i n c l u d e"s t d i o.h" #include "stdlib.h"
#include "string.h"
#define M 5
struct People
{
int a;
char ming[30];
char xiang[30];
int b;
int c;
}P[M];
void main()
{
int a=1;
void menu_1(int a);
menu_1(a);
}
void menu_1(int a)
{
void menu_2();
void menu_3();
void biao_1();
int loop=1;
while(loop)
{
system("cls");
printf("\t WELCOME \n");
printf("\t--------------------(*^◎^*)--------------------\n");
printf("\t- -\n");
printf("\t- -\n");
printf("\t- 1.小区用户管理-\n");
printf("\t- 2.物业收费管理-\n");
printf("\t- 3.生成小区住户收费报表-\n");
printf("\t- 4.退出-\n");
printf("\t- -\n");
printf("\t- -\n");
printf("\t-------------------o(╯□╰)o-------------------\n");
printf("\t END \n");
printf("请输入所要选择内容的序号(1-4):[ ]\b\b");
scanf("%d",&a);
switch(a)
{
case 2:menu_3();break;
case 3:biao_1();break;
case 4:exit(0);break;
default :exit(0);
}
getchar();
getchar();
}
}
void menu_2()
{
void scan_1();
void add_1();
void rewrite_1();
void delete_1();
void seek_1();
int a;
system("cls");
printf("\t *欢迎使用小区用户管理系统* \n");
printf("\t-----------------↖(^ω^)↗---------------------\n");
printf("\t- -\n");
printf("\t- -\n");
printf("\t- 1.浏览用户资料-\n");
printf("\t- 2.录入用户资料-\n");
printf("\t- 3.更改用户资料-\n");
printf("\t- 4.删除用户资料-\n");
printf("\t- 5.查找用户资料-\n");
printf("\t- -\n");
printf("\t- -\n");
printf("\t-----------------O(∩_∩)O~---------------------\n");
printf("\t END \n");
printf("请输入所要选择内容的序号(1-3):[ ]\b\b");
scanf("%d",&a);
switch(a)
{
case 1:scan_1();break;
case 2:add_1();break;
case 3:rewrite_1();break;
case 4:delete_1();break;
case 5:seek_1();break;
default:exit(0);
}
}
void scan_1()
{
char ch;
if((fp=fopen("e:\\data.txt","r+"))==NULL)
{
printf("cannot open the file!");
exit(0);
}
ch=fgetc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=fgetc(fp);
}
fclose(fp);
printf("\n");
}
void add_1()
{
FILE *fp;
if((fp=fopen("e:\\data.txt","a"))==NULL)
{
printf("文件不能打开/n");
exit(0);
}
else
{
int i;int num;
printf("输入所要输入数据的数目=");
scanf("%d",&num);
for(i=2;i { printf("编号:"); scanf("%d",&P[i].a); printf("姓名:"); scanf("%s",P[i].ming); printf("项目:"); scanf("%s",P[i].xiang); printf("已交:"); 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].xiang,P[i].b,P[i].c); fprintf(fp,"\n"); } fclose(fp); }