예제 #1
0
    public static void Main()
    {
        QueueHandler tMarket = new QueueHandler();
        while (true)
        {
            string[] attribs = Console.ReadLine().Split(new string[] {" ", "\t", "/t" },
                StringSplitOptions.RemoveEmptyEntries);

            switch (attribs[0])
            {
                case "Append":
                    tMarket.Append(attribs[1]);
                    break;
                case "Insert":
                    tMarket.Insert(int.Parse(attribs[1]), attribs[2]);
                    break;
                case "Find":
                    tMarket.Find(attribs[1]);
                    break;
                case "Serve":
                    tMarket.Serve(int.Parse(attribs[1]));
                    break;
                case "End":
                    Console.WriteLine(tMarket.Buffer.ToString());
                    return;
                default: break;
            }
        }
    }