Created
January 10, 2026 07:03
-
-
Save VladimirYus/7a92d4a438422fc954d5c4e3990f9728 to your computer and use it in GitHub Desktop.
QueueStore
This file contains hidden or 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 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