Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace CSharp_Shell
- {
- public static class Program
- {
- public static void Main()
- {
- var input = Console
- .ReadLine();
- var queue = new Queue<string>();
- while(true)
- {
- var command = Console.ReadLine();
- if(command == "Paid")
- {
- for(int i=0;i<queue.Count;i++)
- {
- var people= queue.Dequeue();
- Console.WriteLine(people);
- }
- }
- 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