Пример #1
0
        static void Main(string[] args)
        {
            ElectronicQueue <Person> queue = new ElectronicQueue <Person>();

            queue.AddToTheEnd(new Person("asd", "ssss", 1231));
            Console.WriteLine(queue.ToString());
        }
        static void Main(string[] args)
        {
            ElectronicQueue eq = new ElectronicQueue();

            eq.queue.Enqueue(new Person("A", "B", 21));
            eq.queue.Enqueue(new Person("C", "Q", 1));
            eq.queue.Enqueue(new Person("A", "BBBBBBBBBBBBBBBB", 231));
            eq.queue.Dequeue();
            foreach (Person person in eq.queue)
            {
                Console.WriteLine(person);
            }
        }
        static void Main(string[] args)
        {
            ElectronicQueue <Person> queueOfPersons = new ElectronicQueue <Person>();

            string[] names    = new string[] { "jdjf", "fjjfjf", "JSjd" };
            string[] surnames = new string[] { "Jffdjf", "fjFFFjfjf", "JSjFFFd" };
            int[]    ages     = new int[] { 24, 53, 23 };
            for (int i = 0; i < names.Length; i++)
            {
                queueOfPersons.Enqueue(new Person(names[i], surnames[i], ages[i]));
            }
            Person p = queueOfPersons.Peek();

            Console.WriteLine(p);
        }
Пример #4
0
        static void Main()
        {
            ElectronicQueue queue = new ElectronicQueue();

            Person[] array = new Person[]
            {
                new Person("Arthur", "Levinson", 70),
                new Person("Tim", "Cook", 60),
                new Person("Jeff", "Williams", 58)
            };
            queue.Enqueue(array[0]);
            queue.Enqueue(array[1]);
            queue.Dequeue();
            queue.Enqueue(array[2]);
            Array.ForEach(queue.ToArray(), person => Console.WriteLine(person));
        }