Anonim_999

shop

Apr 4th, 2021 (edited)
729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ConsoleApp2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int countEtrations;
  10.             int score = 0;
  11.             int tempAmountPuchases;
  12.             Queue<int> amountPurchases = new Queue<int>();
  13.  
  14.             for (int i = 0; i < 10; i+= 2)
  15.             {
  16.                 amountPurchases.Enqueue(i);
  17.             }
  18.  
  19.             countEtrations = amountPurchases.Count;
  20.  
  21.             for (int i = 0; i < countEtrations; i++)
  22.             {
  23.                 Console.Clear();
  24.                 tempAmountPuchases = amountPurchases.Dequeue();
  25.                 Console.WriteLine($"Клиент {i} сделал покупку на {tempAmountPuchases}");
  26.                 score += tempAmountPuchases;
  27.                 Console.WriteLine($"Счет: {score}");
  28.                 Console.ReadKey();
  29.             }
  30.         }
  31.     }
  32. }
  33.  
  34.  
Add Comment
Please, Sign In to add comment