}
break;
}
}
cout<<"\n\t==============================================================\n\n";
cout<<"\n\t";
system("pause");看挂号情况\t2.各科就诊人数\t3.患者年龄段\t4.挂号收入情况\n\n\t5.打印病人名单";
cout<<"\tr.返回!
\tq.退出!
\n";
cout<<"\n\t==============================================================\n";
cout<<"\n\t请输入编号(1,2,3,4,5,6,r,q):
";
cin>>temp;号功能\t2.统计功能\t3.查找与退挂\tq.退出\n";
cout<<"\n\n\t=============================================================\n";
cout<<"\n\t请输编号(1,2,q):
";
cin>>temp;xt","wb");
fp1=fopen("患者名单.txt","wb");xt","wb");
fp4=fopen("挂号人数.txt","wb");
xt","wb");
fp6=fopen("各科人数.txt","wb");
fprintf(fp2,"%ld\n%ld\n",I,L);."<
}
}
xt","rb");
fp1=fopen("患者名单.txt","rb");xt","rb");
fp4=fopen("挂号人数.txt","rb");
xt","rb");
fp6=fopen("各科人数.txt","rb");
fscanf(fp2,"%ld%ld",&I,&L);."<
}
}
oom&&age2==P[j].age)
{
if(flag==1)
{
clear();
cout<<"\n\t\t\t系统查找到以下信息:
\n";
cout<<"\n\t==============================================================\n";
cout<<"\t患者编号"<<"\t性别"<<"\t科室"<<"\t急诊"<<"\t专家门诊\n";
flag=0;
}
cout<<"\t"<
}
}
charch='0',temp1[10]="";
do
{
cout<<"\n\n\n\t\t以上是否有您的信息:
";
cin>>temp1;
ch=tolower(temp1[0]);
}
while(ch!
='y'&&ch!
='n');
switch(ch)
{
case'y':
{
chartemp[10];
longi=-1;
while(i<=0)um<<"\t"<
break;
}
case'n':
cout<<"\n\n\t建议您到服务窗口去查找!
\n\n\n\t";
break;
}
system("pause");."<
}
clear();
cout<<"\n\t==============================================================\n";
cout<<"\t患者编号"<<"\t性别"<<"\t科室"<<"\t急诊"<<"\t专家门诊\n";
cout<<"\t"<
system("pause");诊号查找\t2.模糊查找\t3.退订号\t4.清除数据\n\n";
cout<<"\tr.返回!
\tq.退出!
\n";
cout<<"\n\t==============================================================\n";
cout<<"\n\t请输入编号(1,2,3,4,r,q):
";
cin>>temp;oom)
{
case'1':
renshu[0]--;
break;
case'2':
renshu[1]--;
break;
case'3':
renshu[2]--;
break;
case'4':
renshu[3]--;
break;
case'5':
renshu[4]--;
break;
}
ge='0';
P[i-1].zp='0';
P[i-1].room='0';
strcpy(P[i-1].num,"0");
ime,"")!
=0)
{
;
}
elseif(strcmp(P[i-1].jz,"是")==0)
{
;
}
else
{
;
}
clear();
cout<<"\n\n\n\t\t单号已经退订成功!
\n\t";
system("pause");
return1;
}
oom)
{
case'1':
renshu[0]--;
break;
case'2':
renshu[1]--;
break;
case'3':
renshu[2]--;
break;
case'4':
renshu[3]--;
break;
case'5':
renshu[4]--;
break;
}
ge='0';
P[i-1].zp='0';
P[i-1].room='0';
strcpy(P[i-1].num,"0");
ime,"")!
=0)
{
;
}
elseif(strcmp(P[i-1].jz,"是")==0)
{
;
}
else
{
;
}
clear();
cout<<"\n\n\n\t\t单号已经退订成功!
\n\n";
system("pause");
return1;
}
xt","wb");
fp1=fopen("患者名单.txt","wb");xt","wb");
fp4=fopen("挂号人数.txt","wb");
fp6=fopen("各科人数.txt","wb");
remove("全局变量.txt");
remove("患者名单.txt");
remove("预约名单.txt");
remove("挂号人数.txt");
remove("各科人数.txt");
fclose(fp4);
fclose(fp3);
fclose(fp1);
fclose(fp2);
fclose(fp6);
system("cls");
cout<<"\n\n\n\t\t本地数据已经全部清除!
\n\n";
exit
(1);
}
else//选择了否
{
return1;
}
cout<<"\n\n\n\t\t本地数据已经全部清除!
\n\n";
system("pause");
return1;
}
#include""
//-----------主函数--------------
intmain()
{
system("color3F");
hospitalhp;//定义一个对象
();
return0;
}
#ifndefHOSPITAL_H_INCLUDED
#defineHOSPITAL_H_INCLUDED
#include<>
#include
#include
#include
#include
#include<>
#include<>
classhospital//定义医院类
{
public:
intdelete_file();//删除本地文件
intdelete1();//重载删除函数
intdelete1(longi);//删除函数
intcz_menu();//查找删除函数菜单
intserch(inti);//重载serch函数实现两种不同查找方式
intserch();//查找删除函数
voidf_write();//写文件函数,用于在程序关闭之前保存数据到本地
voidf_read();//读文件函数,用于在程序打开之前读取数据要程序中
intinput();//输入函数
voidmenu();//主菜单函数
voidtj();//统计功能函数
intgh_menu();//挂号功能选择菜单
inttj_menu();//统计功能选择菜单函数
intgjzh();//挂急诊号
intyygh();//预约挂号函数
intghxd();//挂号向导函数
intghrs();//挂号情况统计函数
intjzrs();//各科就诊人数统计函数
intnlb();//年龄人数统计函数
intghsr();//挂号收入情况
intgdrh();//挂当日号函数
intshow();//展示病人名单
voidroom(charroom);//分诊室函数
};
#endif//HOSPITAL_H_INCLUDED