using System.Text;
namespace QueueMachine
{
//设计一个叫号机程序,输入1表示有人进队,输入2表示有人离开队列接受服务,3表示列出队列的成员和成员数目,0表示退出程序。
//已给定主程序,要求将三个函数补充完整
class Program
{
static void addQueue(Queue q)
{
//要求输入一个名字,将此人加入到队列中
}
static void leaveQueue(Queue q)
{
//要求从队列中出来一个人,比如接受服务
}
static void listQueue(Queue q)
{
//输出队列中一共有多少人,并输出每个人名字
}
static void Main(string[] args)
{
int i=0;
Queue q = new Queue(50);
Console.WriteLine("This is a queue machine."+
"You can type the following digits: \n"+
"\t1 for entering the queue, \n"+
"\t2 for leaving the queue, \n"+
"\t3 for listing the members in the queue,\n"+
"\t0 for exiting:");
do
{
i = Convert.ToInt32(Console.ReadLine());
if (i == 1)
{
addQueue(q);
}
else if (i == 2)
{
leaveQueue(q);
}
else if (i == 3)
{
listQueue(q);
}
else if(i==0)
{
break;
}
else
Console.WriteLine("wrong input");
} while (true);