Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Homework2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Queue<int> clients = new Queue<int>();
- int money = 0;
- clients.Enqueue(123);
- clients.Enqueue(34234);
- clients.Enqueue(9231);
- clients.Enqueue(1300);
- clients.Enqueue(225);
- while (clients.Count > 0)
- {
- Console.WriteLine("Сейчас обслуживается клиент с покупкой на " + clients.Peek() + " рублей. " + "Вы заработали " + money);
- Console.WriteLine("Осталось клиентов:" + clients.Count);
- Console.WriteLine("Нажмите любую клавишу, чтобы обслужить...");
- Console.ReadKey();
- money += clients.Dequeue();
- Console.Clear();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment