Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DemoQueue2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Demo Queue - versión librería estándar");
- Queue<int> queue1 = new Queue<int>();
- Queue<char> queue2 = new Queue<char>();
- Random random = new Random();
- int number;
- char character;
- Console.WriteLine("Enqueuing...");
- for (int c = 0; c < 10; ++c)
- {
- queue1.Enqueue(number = random.Next(-5000, 5001));
- queue2.Enqueue(character = (char)random.Next(65, 90));
- Console.Write("{0} {1} ", number, character);
- }
- Console.WriteLine();
- Console.WriteLine("Dequeuing...");
- while (queue1.Count > 0)
- {
- Console.Write("{0} {1} ", queue1.Dequeue(), queue2.Dequeue());
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement