public static void Main() { StackOfStrings stack = new StackOfStrings(); stack.Push("Pesho"); stack.Push("Ivan"); stack.Push("Gosho"); Console.WriteLine(stack.Peek()); Console.WriteLine(stack.IsEmpty()); stack.Pop(); stack.Pop(); stack.Pop(); Console.WriteLine(stack.IsEmpty()); }
public static void Main() { var customStack = new StackOfStrings(); customStack.AddRange(""); System.Console.WriteLine(customStack.IsEmpty()); }
public static void Main() { /* * var randomList = new RandomList(); * * randomList.Add(1); * randomList.Add(2L); * randomList.Add(3.0); * randomList.Add(true); * randomList.Add("5"); * * Console.WriteLine(randomList.RandomString()); */ var stackOfStrings = new StackOfStrings(); stackOfStrings.Push("1"); stackOfStrings.Push("2"); stackOfStrings.Push("3"); Console.WriteLine(stackOfStrings.Peek()); Console.WriteLine(stackOfStrings.Pop()); Console.WriteLine(stackOfStrings.Peek()); Console.WriteLine(stackOfStrings.IsEmpty()); }
private static void Main(string[] args) { var stringStack = new StackOfStrings(); var item = "item"; stringStack.Push(item); stringStack.Pop(); stringStack.Peek(); stringStack.IsEmpty(); }
static void Main(string[] args) { List <string> newList = Console.ReadLine().Split().ToList(); var stack = new StackOfStrings(newList); stack.Push("pesho"); Console.WriteLine(stack.Peek()); Console.WriteLine(stack.Pop()); Console.WriteLine(stack.Pop()); Console.WriteLine(stack.IsEmpty()); }
static void Main() { // test class StackOfStrings var myStack = new StackOfStrings(); myStack.Push("a"); myStack.Push("b"); myStack.Push("c"); myStack.Pop(); string peek = myStack.Peek(); bool isEmpty = myStack.IsEmpty(); }
static void Main(string[] args) { StackOfStrings list = new StackOfStrings(); list.Push("Nasko"); list.Push("Asi"); list.Push("Ivan"); list.Push("Matiq"); Console.WriteLine(list.Pop()); Console.WriteLine(list.Peek()); Console.WriteLine(list.IsEmpty()); }
public static void Main() { List <string> test = new List <string> { "Gosho", "Pesho", "Ivan" }; StackOfStrings newstack = new StackOfStrings(test); newstack.Peek(); newstack.IsEmpty(); newstack.Pop(); newstack.Push("aas"); }
static void Main() { StackOfStrings stack = new StackOfStrings(); stack.Push("kur"); stack.Push("putka"); stack.Pop(); stack.Pop(); if (!stack.IsEmpty()) { foreach (var item in stack.Stack) { Console.WriteLine(item); } } }
public static void Main() { var data = new StackOfStrings(); data.Push("one"); Console.WriteLine(data.IsEmpty()); try { Console.WriteLine(data.Pop()); Console.WriteLine(data.Peek()); } catch (Exception e) { Console.WriteLine(e.Message); } }