Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace CSLight
- {
- public class Program
- {
- static void Main(string[] args)
- {
- Queue<int> buyers = new Queue<int>();
- buyers.Enqueue(1);
- buyers.Enqueue(5);
- buyers.Enqueue(3);
- buyers.Enqueue(4);
- buyers.Enqueue(2);
- int bank = 0;
- while (buyers.Count > 0)
- {
- int currentPayment = buyers.Dequeue();
- bank += currentPayment;
- Console.WriteLine($"Клиент у кассы. Он заплатил: {currentPayment}. В кассе: {bank}");
- Console.WriteLine("Нажмите любую клавишу...");
- Console.ReadKey();
- Console.Clear();
- }
- Console.WriteLine("Все клиенты обслужены!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement