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 CSLight
- {
- class Program
- {
- static void Main(string[] args)
- {
- int balance = 0;
- Queue<int> clients = new Queue<int>();
- clients.Enqueue(23);
- clients.Enqueue(12);
- clients.Enqueue(47);
- clients.Enqueue(89);
- clients.Enqueue(17);
- bool isNotQueueEmpty = clients.Count > 0;
- while (isNotQueueEmpty)
- {
- Console.Clear();
- Console.WriteLine($"Ваш баланс - {balance}");
- Console.WriteLine($"Выполняется транзакция на сумму - {clients.Peek()}");
- balance += clients.Dequeue();
- Console.ReadKey();
- }
- Console.WriteLine($"\n-----------------\n\nИтого: {balance}");
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment