#include<iostream>
#include<string>
using namespace std;
template<class T>
class Student{
public:
Student(){
front=rear=49;}
void enqueue(T x);
T dequeue();
T getqueue();
int empty(){
if(front==rear) return 1;
return 0;}
private:
int front,rear;
T data[50];
};
template<class T>
void Student<T>::enqueue(T x){
if((rear+1)%50==front) throw "上溢";
rear=(rear+1)%50;
data[rear]=x;
}
template<class T>
T Student<T>::dequeue(){
if(rear==front) throw "下溢";
front=(front+1)%50;
return data[front];
}
template<class T>
T Student<T>::getqueue(){
if(rear==front) throw "下溢";
int i=(front+1)%50;
return data[i];
}
void main(){
Student<string> stu;
string a[3]={"小明","小李","小栋"};
for(int i=0;i<3;i++){
stu.enqueue(a[i]);
}
cout<<stu.dequeue()<<endl;
cout<<stu.getqueue()<<endl;
}