template.h

来自「宾馆住宿管理系统,包括住宿登记,计费,退房,查看当前空房等功能.」· C头文件 代码 · 共 57 行

H
57
字号
#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 + =
减小字号Ctrl + -
显示快捷键?