Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countEtrations;
- int score = 0;
- int tempAmountPuchases;
- Queue<int> amountPurchases = new Queue<int>();
- for (int i = 0; i < 10; i+= 2)
- {
- amountPurchases.Enqueue(i);
- }
- countEtrations = amountPurchases.Count;
- for (int i = 0; i < countEtrations; i++)
- {
- Console.Clear();
- tempAmountPuchases = amountPurchases.Dequeue();
- Console.WriteLine($"Клиент {i} сделал покупку на {tempAmountPuchases}");
- score += tempAmountPuchases;
- Console.WriteLine($"Счет: {score}");
- Console.ReadKey();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment