Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace CSLight
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberOfClients, clientMoney ;
- int storeProfit = 0;
- Queue<int> amountOfPurchases = new Queue<int>();
- amountOfPurchases.Enqueue(1);
- amountOfPurchases.Enqueue(1);
- amountOfPurchases.Enqueue(1);
- amountOfPurchases.Enqueue(1);
- amountOfPurchases.Enqueue(1);
- amountOfPurchases.Enqueue(1);
- numberOfClients = amountOfPurchases.Count;
- for (int i = 0; i < numberOfClients; i++)
- {
- clientMoney = amountOfPurchases.Dequeue();
- storeProfit += clientMoney;
- Console.WriteLine($"Прибыль магазина после обслуживания клиента: {storeProfit}");
- Console.ReadKey();
- Console.Clear();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment