📄 template.h
字号:
#include<iostream.h>
#include"Tab.h"
#include"ROOM.h"
#include"Standardroom.h"
#include"Threeroom.h"
#include"VIProom.h"
void DR(); /* 显示房间门牌号的多态函数 */
void DR(ROOM& x) /* 定义显示房间的多态 */
{
x.display();
}
template<class T>
void display(int b,T a[b])
{
cout<<"此类剩余房间如下"<<endl;
for(int i=0;i<b;i++)
{
for(int j=0;j<35;j++)
{
if(a[i].Rroom()==tb[j].Rtabroom())
break;
if(j==34)
DR(a[i]);
}
if(i==b-1)
cout<<endl<<"此类房间单价"<<a[0].Prc()<<"元每天"<<endl;
}
}
template<class T>
int Doorplate(int b,T a[b],int doorplate)
{
for(int i=0;i<35;i++)
{
for(int j=0;j<b;j++)
{
if(doorplate != a[j].Rroom()||doorplate==tb[i].Rtabroom())
{
if(j<b-1)
continue;
else
{
cout<<" 请从以上给出的空房间中选择 "<<endl;
cin>>doorplate;
j=-1;
}
}
else
break;
}
}
return doorplate;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -