Advertisement
Guest User

Untitled

a guest
Apr 12th, 2020
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace _6._Supermarket
  6. {
  7. class Program
  8. {
  9. static void Main()
  10. {
  11. Queue<string> clients = new Queue<string>();
  12. string input;
  13. while ((input =Console.ReadLine())!= "End")
  14. {
  15. if (input == "Paid")
  16. {
  17. while (clients.Any())
  18. {
  19. Console.WriteLine(clients.Dequeue());
  20. }
  21. }
  22. else
  23. {
  24. clients.Enqueue(input);
  25. }
  26. }
  27. Console.WriteLine($"{clients.Count} people remaining.");
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement