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