Skip to content

Instantly share code, notes, and snippets.

@VladimirYus
Created January 10, 2026 07:03
Show Gist options
  • Select an option

  • Save VladimirYus/7a92d4a438422fc954d5c4e3990f9728 to your computer and use it in GitHub Desktop.

Select an option

Save VladimirYus/7a92d4a438422fc954d5c4e3990f9728 to your computer and use it in GitHub Desktop.
QueueStore
using System;
using System.Collections.Generic;
namespace QueueStore
{
internal class Program
{
static void Main(string[] args)
{
int cashRegister = 0;
Queue<int> purchases = new Queue<int>(new[] { 100, 200, 300, 400, 500 });
while (purchases.Count > 0)
{
cashRegister += purchases.Dequeue();
Console.WriteLine(cashRegister);
Console.ReadKey();
Console.Clear();
}
Console.WriteLine(cashRegister);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment