using namespace std;
const int SIZE=100;
// Создание обобщенного класса queue.
template <class QType>
class queue{
QType q[SIZE];
int sloc, rloc;
public:
queue() { sloc = rloc =0; }
void qput(QType i);
QType qget();
};
// Занесение объекта в очередь.
template <class QType>
void queue<QType>::qput(QType i)
{
if(sloc==SIZE) {
cout << "Очередь заполнена.\n";
return;
}
sloc++;
q[sloc] = i;
}
// Извлечение объекта из очереди.
template <class QType>
QType queue<QType>::qget()
{
if(rloc == sloc) {
cout << "Очередь пуста.\n";
return 0;