Skip to content

Instantly share code, notes, and snippets.

@trayforyou
Created April 27, 2024 11:29
Show Gist options
  • Save trayforyou/626fe260c4a34ae554a70425c6ed99ac to your computer and use it in GitHub Desktop.
Save trayforyou/626fe260c4a34ae554a70425c6ed99ac to your computer and use it in GitHub Desktop.
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