#i nclude "stdio.h"
#i nclude "stdlib.h"
#include "string.h"
#defi ne M 5 struct People
{
int a;
char min g[30]; char xia ng[30];
int b;
int c;
}P[M];
void mai n()
{
int a=1;
void menu _1(i nt a); menu _1(a);
} void menu _1(i nt a)
{
void menu _2();
void menu _3();
void biao_1(); int loop=1;
while(loop)
{
system("cls");
prin tf("\t
WELCOME\n");
printf("\t——
(*A◎ A*)
\n ”);
prin tf("\t-
-\n");
prin tf("\t-
-\n");
prin tf("\t-
1.小区用户管理
-\n");
prin tf("\t-
2.
物业收费管理
-\n");
prin tf("\t-
3.
生成小区住户收费报表-\n");
prin tf("\t-
4.
退出
-\n");
prin tf("\t-
-\n");
prin tf("\t-
-\n");
printf("\t——
---0(
丿 口3)0—
\n");
prin tf("\t
END
\n");
prin tf(”请输入所要选择内容的序号(1-4):[ ]\b\b");
scan f("%d", &a);
switch(a)
{
case 1:me nu _2();break;
case 2:me nu _3();break;
case 3:biao_1();break;
case 4:exit(0);break;
default :exit(0);
}
getchar();
getchar();
}
} void menu _2()
{
void sca n_1(); void add_1();
void rewrite_1();
欢迎使用小区用户管理系统*\n");
欢迎使用小区用户管理系统*\n");
\ (A 3 A) /\n");
-\n");
-\n");
printf("\t
prin tf("\t- prin tf("\t-
prin tf("\t-
1.
浏览用户资料
-\n");
prin tf("\t-
2.
录入用户资料
-\n");
prin tf("\t-
3.
更改用户资料
-\n");
prin tf("\t-
4.
删除用户资料
-\n");
prin tf("\t-
5.
查找用户资料
-\n");
prin tf("\t-
-\n");
prin tf("\t-
-\n");
printf("\t——
--0(
n n )O
\n ”);
prin tf("\t
END
\n");
printf(”请输入所要选择内容的序号(1-3):[ ]\b\b");
scan f("%d",&a);
switch(a)
{
case 1:sca n_1();break;
case 2:add_1();break;
case 3:rewrite_1();break;
case 4:delete_1();break;
case 5:seek_1();break;
default:exit(O);
void sca n_1()
{
FILE *fp;
char ch;
if((fp=fope n("e:\\data.txt","r+"))==NULL) {
prin tf("ca nnot ope n the file!"); exit(0);
}
ch=fgetc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=fgetc(fp);
}
fclose(fp);
prin tf("\n");
void add_1()
{
FILE *fp;
if((fp=fope n( ”e:\\data.txt”,”a”))==NULL) {
printf("文件不能打开/n”);
exit(0);
}
else
{
int i;i nt num;
printf("输入所要输入数据的数目=");
scan f("%d", &n um);
for(i=2;i
{
printf("编号:");
scan f("%d",&P[i].a);
printf("姓名:"); scan f(”%s”,P[i].mi ng);
printf("项目:"); scan f("%s",P[i].x