Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [StartCode]
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp17
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Queue<int> purchases = new Queue<int>();
- purchases.Enqueue(5);
- purchases.Enqueue(6);
- purchases.Enqueue(7);
- purchases.Enqueue(8);
- purchases.Enqueue(9);
- int storeMoney = 0;
- while(purchases.Count > 0)
- {
- int purchaseMoney = purchases.Dequeue();
- storeMoney += purchaseMoney;
- ShowCashier(storeMoney);
- }
- }
- static void ShowCashier(int storeMoney)
- {
- Console.SetCursorPosition(0, 0);
- Console.Write("В кассе " + storeMoney + " рублей . Нажмите любую клавишу для продолжения.");
- Console.ReadKey();
- }
- }
- }
- [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment