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