Created
April 27, 2024 11:29
-
-
Save trayforyou/626fe260c4a34ae554a70425c6ed99ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Collections1 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Queue<int> numbers = new Queue<int>(); | |
int moneyInCashRegister = 0; | |
numbers.Enqueue(1); | |
numbers.Enqueue(10); | |
numbers.Enqueue(100); | |
numbers.Enqueue(1000); | |
numbers.Enqueue(10000); | |
Console.WriteLine($"Денег в кассе : {moneyInCashRegister}."); | |
Console.ReadKey(); | |
while (numbers.Count > 0) | |
{ | |
Console.Clear(); | |
moneyInCashRegister += numbers.Dequeue(); | |
Console.WriteLine($"Денег в кассе: {moneyInCashRegister}."); | |
Console.ReadKey(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment