static void PopElementFromStack(MyCollection <Place> stack) { if (stack.Count == 0) { Output.Error("Стек пуст\n"); } else { stack.Remove(); } }
static void RemoveElementFromKeyboard(MyCollection <Place> stack) { if (stack.Count == 0) { Output.Error("Стек пуст\n"); } else { Place element = CreateElement(); if (stack.Remove(element)) { Output.Success("Элемент удалён\n"); } else { Output.Error("Элемента нет в стеке\n"); } } }