Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Win32;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Homework34
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Queue<int> buyers = new Queue<int>(5);
- buyers.Enqueue(5);
- buyers.Enqueue(6);
- buyers.Enqueue(7);
- buyers.Enqueue(89);
- buyers.Enqueue(8);
- int moneyInСashRegister = 0;
- while (buyers.Count > 0)
- {
- Console.WriteLine("Клиентов в очереди осталось: " + buyers.Count);
- Console.WriteLine("Нажмите любую кнопку чтобы обслужить клиента");
- Console.WriteLine("Денег в кассе: " + moneyInСashRegister);
- moneyInСashRegister += buyers.Dequeue();
- Console.ReadKey();
- Console.Clear();
- }
- if (buyers.Count == 0)
- {
- Console.WriteLine("Очередь пуста!!!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement