Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- using System.Threading;
- namespace CSharp_Shell
- {
- public static class Program
- {
- public static void Main()
- {
- var queue = new Queue<string>();
- while (true)
- {
- var command = Console.ReadLine();
- if (command == "Paid")
- {
- while (queue.Any())
- {
- Console.WriteLine(queue.Dequeue());
- }
- }
- else if (command == "End")
- {
- Console.WriteLine($"{queue.Count} people remaining.");
- return;
- }
- else
- {
- queue.Enqueue(command);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement