Exemplo n.º 1
0
 static void PopElementFromStack(MyCollection <Place> stack)
 {
     if (stack.Count == 0)
     {
         Output.Error("Стек пуст\n");
     }
     else
     {
         stack.Remove();
     }
 }
Exemplo n.º 2
0
 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");
         }
     }
 }