楼盘销售系统源代码Word文档下载推荐.docx
- 文档编号:22002747
- 上传时间:2023-02-02
- 格式:DOCX
- 页数:28
- 大小:20.87KB
楼盘销售系统源代码Word文档下载推荐.docx
《楼盘销售系统源代码Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《楼盘销售系统源代码Word文档下载推荐.docx(28页珍藏版)》请在冰豆网上搜索。
{
charnum[8];
/*楼号*/
charprice[20];
/*价格(/㎡)*/
charchaoxiang[20];
/*面向*/
intarea;
/*面积*/
structchaoxiang_typeweizhi;
/*单元信息*/
structchaoxiang_typekind;
/*类型*/
structuser_type//用户信息结构体
{
charusername[15],
password[15];
}user;
intnumber;
intm;
//登录选择
/*读取信息模块*/
intread_file(structloupans_typeloupan[])
{FILE*fp;
inti=0;
if((fp=fopen("
loupans.txt"
"
rt"
))==NULL)
{printf("
\n库存文件不存在,请创建!
\n"
);
return0;
}
while(!
feof(fp))
{fread(&
loupan[i],sizeof(structloupans_type),1,fp);
if(loupan[i].num==0)
break;
else
i++;
fclose(fp);
returni;
}
/*保存信息模块*/
voidsave_file(structloupans_typeloupan[],intsum)
inti;
wt"
{printf("
读文件错误\n"
return;
for(i=0;
i<
sum;
i++)
if(fwrite(&
loupan[i],sizeof(structloupans_type),1,fp)!
=1)
printf("
写文件错误\n"
intprint1(void)//*登录菜单打印
printf("
\t\t**********************************************\n\n"
\t\t************欢迎登录楼盘销售管理系统!
*************\n\n"
\t\t**********************************************\n"
\t\t\t*************************\n"
\t\t\t*\t◆1注册:
\t*\n"
\t\t\t*\t\t\t*\n"
\t\t\t*\t◆2登录:
\t\t\t*\t◆3退出:
\t\t\t*************************\n\n"
\t\t\t请按序号输入你的选择:
\n\t\t\t"
scanf("
%d"
&
m);
return(m);
/*登录模块*/
//*登录程序
intlogin(void)
intflag=1,str1,str2,time=0;
inti,n=0;
charch=0;
FILE*fp;
structuser_typeuser1;
system("
cls"
\n\n\n\n"
while(flag)
switch(m)
case1:
\t\t\t★!
注册小提示:
\n\n"
\t\t\t用户名和密码不得超过15个字符!
\n\n"
fp=fopen("
f:
/password.txt"
if(fp==NULL)
\t\t\t★对不起,此文件打不开:
getch();
exit
(1);
\t\t\t★请输入你的用户名:
\n\n\t\t\t"
fflush(stdin);
gets(user1.username);
printf("
\n\t\t\t★请你输入密码:
ch=getch();
i=0;
while(ch!
='
\r'
)
user1.password[i]=ch;
*"
if(ch==8)
\b\b\b\b"
i--;
elsei++;
user1.password[i]='
\0'
;
fprintf(fp,"
%s\n%s\n"
user1.username,user1.password);
fclose(fp);
flag=0,n=1;
\t\t\t★注册成功!
break;
case2:
//未注册直接登录
\t\t\t对不起,此文件打不开:
fscanf(fp,"
user.username,user.password);
printf("
\t\t\t★请你输入密码:
user1.password[i]=0;
str1=strcmp(user1.username,user.username);
str2=strcmp(user1.password,user.password);
if(str1==0&
&
str2==0)
\t\t\t★成功登录!
return
(1);
}
else
\n\n\n\n\t\t\t★登录失败,请重新登录!
time++;
if(time==3)//登录次数超过三次自动退出
\n\n\n\n\t\t\t★你超过登录次数,对不起!
"
}
case3:
print1();
flag=1;
if(n)
\n\n\n\n\n"
\t\t\t你已经注册,请你登录!
//注册后登录
while(flag)
\n\n\n\t\t\t"
\n\n\n\t\t\t★请你输入密码:
for(i=0;
ch!
//判断密码是否正确
str2==0)
\t\t\t登录失败!
flag=0;
return(0);
/*输入模块*/
intinput(structloupans_typeloupan[])
inti=0;
system("
\n\t请输入要录入的楼盘的个数(最多%d个):
MAX);
number);
\n\n\t录入楼盘信息(最多录入%d个)\n"
number);
---------------------------------------\n"
while(i<
number)
\n\t\t第%d个楼盘"
i+1);
printf(“\n\n\t\t\t楼盘楼号:
(000)”);
%s"
loupan[i].num);
if(loupan[i].num==0)break;
\n\t\t\t价格(/㎡):
"
loupan[i].price);
\n\t\t\t面向:
loupan[i].chaoxiang);
\n\t\t\t面积(单位:
㎡):
loupan[i].area);
\n\t\t\t楼盘单元信息(单元-层):
%d-%d"
loupan[i].weizhi.danyu,&
loupan[i].weizhi.loucen);
\n\t\t\t楼盘类型(厅-室):
loupan[i].kind.danyu,&
loupan[i].kind.loucen);
i++;
\n\t\t\t%d个楼盘信息录入完毕!
i);
getchar();
\n\t\t\t按回车键返回主菜单!
returni;
/*输出模块*/
voidoutput(structloupans_typeloupan[],intsum)
\n\n\n"
\n\t\t\t----楼盘信息表----\n\n"
楼盘楼号--单元信息(单元-层)--类型(厅-室)---面积(单位:
㎡)--面向--价格(/㎡)\n"
----------------------------------------------------------------------------\n"
do
fread(&
if(loupan[i].num!
=0)
printf(“%6s%10d-%2d%10d-%2d\t%4d㎡%8s%3s\n”,loupan[i].num,loupan[i].weizhi.danyu,loupan[i].weizhi.loucen,loupan[i].kind.danyu,loupan[i].kind.loucen,loupan[i].area,loupan[i].chaoxiang,loupan[i].price);
}while(i<
sum);
printf(“\t\t\t按回车键返回主菜单”);
/*修改模块*/
voidmodify(structloupans_typeloupan[],intsum)
inti=0,choice,flag;
charmodify_num[8];
\n输入要修改的楼盘的楼号:
modify_num);
if(!
strcmp(loupan[i].num,modify_num))
\n\t\t\t----楼盘信息----\n"
\t\t\t1.楼盘楼号\n\n\t\t\t2.价格(/㎡)\n\n\t\t\t3.面向\n\n\t\t\t4.面积(单位:
㎡)\n\n\t\t\t5.单元信息(单元-层)\n\n\t\t\t6.类型(厅-室)\n"
请输入要修改项的楼号(选择1-6):
choice);
switch(choice)
\n\t\t\t输入修改后的楼盘楼号:
(000):
\n\t\t\t输入修改后的价格(/㎡):
\n输入修改后的面向:
case4:
\n\t\t\t输入修改后的面积(单位:
㎡):
case5:
\n输入修改后的楼盘单元信息(单元-层):
case6:
\n\t\t\t输入修改后的楼盘类型(厅-室):
\n\t\t\t----楼盘信息----(修改后)\n"
if(i==sum){printf("
\n\t\t\t该楼盘不存在"
getchar();
save_file(loupan,sum);
\n\n继续修改吗?
(Y/N(选择N则返回主菜单))"
choice=getchar();
if(choice=='
Y'
||choice=='
y'
{flag=1;
\n\t\t\t继续修改!
elseflag=0;
}while(flag==1);
/*查询模块*/
voidreserch(structloupans_typeloupan[],intsum)
inti=0,choice,flag,key=0;
charreserch1[8],reserch2[8];
\n请选择查询方式(1或2):
\n\n\t\t1.按楼号\t\t2.按价格(/㎡)\n\t\t"
\n请输入要查询的楼盘的楼号:
reserch1);
strcmp(loupan[i].num,reserch1))
}break;
\n\t\t\t请输入要查询的楼盘的价格范围(/㎡):
printf(“\t\t\t请输入最低价格:
\n\t\t\t”);
scanf(“%s”,reserch1);
printf(“\n\n\t\t\t请输入最高价格:
reserch2);
if(strcmp(loupan[i].price,reserch1)>
0&
strcmp(loupan[i].price,reserch2)<
0)
key=1;
if(1==key)
-------------------------------------------------------
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 楼盘 销售 系统 源代码
![提示](https://static.bdocx.com/images/bang_tan.gif)