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